赞
踩
参考文章:
git remote -v
结果展示
ThinkPad-T450$ git remote -v
origin http://172.16.1.41.git (fetch)
origin http://172.16.1.41.git (push)
一般此时查询的结果只有一个 Fork 仓库远端(共两行 fetch + push)
git remote add origin_official http://172.16.1.41.git
结果展示
ThinkPad-T450$ git remote -v
origin http://172.16.1.41.git (fetch)
origin http://172.16.1.41.git (push)
origin_official http://172.16.1.41.git (fetch)
origin_official http://172.16.1.41.git (push)
查询本地 Fork 仓库应该有两个远端,一个 Fork 仓库远端和一个官方源仓库远端,共四行。
ThinkPad-T450$ git fetch origin_official
ThinkPad-T450$ git branch
* master
也可以切换到其他分支,git checkout 分支名
ThinkPad-T450$ git merge origin_official/master
合并官方源仓库的更新内容到本地仓库对应分支 (一般为 master 分支)。
ThinkPad-T450$ git push origin master
至此,已完成同步官方源仓库 mater 分支的所有更新到 Fork 仓库。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。