远程仓库,个人fork,和本地仓库的逻辑关系如下图:
当远程仓库更新时,需要先把更新拉到本地,合并好后再push到个人fork的仓库中。具体流程为:
-
添加远程仓库到本地remote分支
git remote add upstream http://xxxxxx.git
-
查看当前仓库的远程分支
git remote -v
-
fetch 远程分支
git fetch upstream
-
合并 fetch 的分支到本地(此处应该和develop保持一致,故merge develop分支)
git merge upstream/develop
-
推送本地到远程仓库(自己fork的仓库)
git push