git sync - Agzs/geth-pbft-study GitHub Wiki
假定fork了Xuperchain,后期想同步官方仓库
- upstream: https://github.com/xuperchain/xuperchain.git
- origin: https://github.com/Agzs/xuperchain.git
cd gopath/src/github.com/xuperchain
git remote add upstream https://github.com/xuperchain/xuperchain.git
git remote -v
//从远程仓库upstream获取所有更新
git fetch upstream
//确保分支在主干上
git checkout master
//重写主干上的历史记录
git rebase upstream/master
//强制推送到Github上的远程仓库
git push -f origin master