Fork 仓库分支同步
要同步目标仓库的新建分支到您 fork 的仓库,可以按照以下步骤操作:
添加上游仓库(目标仓库)为远程源:
bashgit remote add upstream <目标仓库的URL>获取上游仓库的更新:
bashgit fetch upstream查看上游仓库的分支:
bashgit branch -r创建并切换到新分支(假设目标仓库中新建的分支名为
new-branch):bashgit checkout -b new-branch upstream/new-branch推送新分支到您的 fork 仓库:
bashgit push origin new-branch
