我们有时候在Github上Fork了别人的项目,但是别人的项目还在更新,怎么保证我们的远程仓库既有我们自己提交的代码,也能合入别人更新的功能呢?
下面是一个简单的例子:
git remote add upstream git@github.com:xxx.git git pull upstream master git push origin master
直接添加一个叫upstream的远程仓库,然后pull,合并冲突后push到自己的仓库就行了。