将 Fork 出来的 GitHub 仓库与上游仓库同步

原文引用https://www.dazhuanlan.com/2019/08/26/5d62fb5f259c2/


以下步骤均基于文档无冲突的情况,如果出现冲突,需要先解决冲突才能继续。

命令均在计算机本地仓库中执行。

添加上游仓库

1
git remote add upstream <上游仓库 URL>

拉取上游仓库(可选使用 rebase 参数)

1
git pull --rebase upstream master

将本地仓库上传到个人 GitHub 仓库

1
git push origin master

猜你喜欢

转载自www.cnblogs.com/petewell/p/11410450.html
今日推荐