git reset
, 一直是我沒有弄懂的部分,這篇要多看幾次
- 節錄文章中的說明
- Reset 這個英文單字的翻譯是「重新設定」,但事實上 Git 的 Reset 指令用中文來說比較像是「前往」或「變成」,也就是「go to」或「become」的概念
$ git reset HEAD~2
- 正確的說,上面這個指令應該要解讀成「我要前往兩個 Commit 之前的狀態」或是「我要變成兩個 Commit 之前的狀態」,而隨著使用不同的參數模式,原本的這些檔案就會丟去不同的區域。
git reset
, 一直是我沒有弄懂的部分,這篇要多看幾次
$ git reset HEAD~2
用 git 的好處,就是可以很方便的建立 & 刪除 branch
就記錄一下,目前有用到的 & 找到的使用 branch 的一些技巧 & 資料
git checkout -b <branch-name>
git push <remote-name> <branch-name>
<remote-name> is typically origin
git push --set-upstream <remote-name> <local-branch-name>
git push -u origin <local-branch-name>
git branch -d <branch>
$ git fetch --prune origin
$ git remote prune <remote>
origin https://gitserver.com/user/repository.git (fetch)
origin https://gitserver.com/user/repository.git (fetch)
`
公司改為使用 enterprises 的 github 服務,因而會發生和自己的 github account 發生衝突的情形,就找了一下解法囉
ssh-add ~/.ssh/id_rsa
ssh-add -d