[Version Control] Git使用紀錄
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
持續更新中!有用到就會更新上來。
Log
只想查版號跟對應的commit內容
分支
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
checkout
到某個分支後,記得先pull
一下。
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
回到前一個工作分支,git checkout -
。
Local沒有但要直接同步Remote的某個分支
檢視
創建(local)
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
如果想要創建(local)分支feature/kickuser
,Local端已經有feature
這個名稱的分支的話,git會丟fatal error。
Example
如果想要創建的分支長這樣
輸入:
刪除(local)
刪除(remote)
TODO!
更新
假如要更新remote branch (feature/kickuser)的到local
[Github] Branching and Pull Request流程
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
push
到remote branch的時候,remote branch的名稱要跟local branch的名稱一樣!
成功推上去後,到剛推的分支下面,會有Compare & pull request
的按鈕,這樣就可以pull request給原作者code review了。
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
如果pull request的內容被comments,修正過後,在conversation的欄位附上更新版的hash code,再從新提交一次code review即可。
突然要緊急處理插件
gitignore for macOS
刪除
已經簽上repo的檔案
指定資料夾與資料夾底下的檔案
刪除已簽上repo的資料夾底下的全部檔案
暫存
改到一半要切到別的分支或pull其他線上分支的時候,可以把剛剛改的變更暫存起來。
提取剛剛的暫存,回到剛剛工作的狀態
清除暫存
Merge & Conflict
情境題:Pull到一半有conflict了,想退回先不合併
情境題:If you're already in conflicted state…
Reset
回到前一版
往回N個版本
`Revert
Reference
If files are not staged
Revert specificed file
Fast Forward
TODO!
Reference