github fork源仓库后保持同步

来源:互联网 发布:如何用手机淘宝装修 编辑:程序博客网 时间:2024/05/22 14:36

保持github主页仓库和本地仓库与源仓库同步

1:fork源仓库
2:clone到本地

git clone git@github.com:username/repositoryname.git

3:添加源仓库路径

git remote add upstream https://github.com/owername/pouch.git

4:源仓库路径设置

git remote set-url --push upstream no-pushing

5:获取源仓库的最新commit

git fetch upstream

6:将最新commit合并到本地

git merge upstream/master

7:将本地代码pull到自己的github

git pull

这时三个仓库就已经保持同步了。

原创粉丝点击