1. 程式人生 > >GCTT(Go Chinese Translation Team) sync.sh同步命令詳解

GCTT(Go Chinese Translation Team) sync.sh同步命令詳解

git remote  add upstream https://github.com/studygolang/GCTT

新增fork專案的遠端倉庫(只需操作一次)

 

此時使用

git remote -v

zuoguoyaodeMacBook-Pro:GCTT zuoguoyao$ git remote -v

origin https://github.com/zuoguoyao/GCTT.git (fetch)

origin https://github.com/zuoguoyao/GCTT.git (push)

upstream 

https://github.com/studygolang/GCTT.git (fetch)

upstream https://github.com/studygolang/GCTT.git (push)

 

git fetch upstream 

獲取上游改動

 

git checkout master 

轉到master分支

git rebase upstream/master 

合併分支,結果等同於merge.git實現的機制不一樣

參考下文

http://gitbook.liuhui998.com/4_2.html

 

git push -f  origin master

強制(-f )覆蓋遠端 origin倉庫的master分支