git 如何使用 SourceTree 更新我的分叉存储库?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/13273852/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 14:53:35 来源:igfitidea点击:
How do I update my forked repo using SourceTree?
提问by Aaron Brager
I am using SourceTree (with BitBucket) to manage my code. I have forked a repo, and the parent repo has been updated.
我正在使用 SourceTree(带有 BitBucket)来管理我的代码。我已经分叉了一个 repo,并且父 repo 已经更新。
How do I use SourceTree to merge the upstream code into my forked repo?
如何使用 SourceTree 将上游代码合并到我的分叉存储库中?
回答by Aaron Brager
First, set up the parent repo:
首先,设置父仓库:
- Open your forked repo in SourceTree.
- Select Repository? Repository Settings…in the menu (or press ??,).
- In the Remotespane, press Add.
- Enter any name you like (often
upstream
ormaster
) and the URL / path to the parent repo. - Press OK, then OK.
- 在 SourceTree 中打开您的分叉存储库。
- 选择存储库?存储库设置...在菜单中(或按??,)。
- 在“远程”窗格中,按“添加”。
- 输入您喜欢的任何名称(通常
upstream
或master
)以及父存储库的 URL/路径。 - 按确定,然后确定。
Now, to update:
现在,更新:
- Select Pull in the toolbar.
- In the "Pull from repository" drop-down, switch from your fork to the repo you just added.
- Press OK.
- (Optional)Once you pull, you may want to push any new content up to the server.
- 在工具栏中选择拉。
- 在“Pull from repository”下拉菜单中,从你的 fork 切换到你刚刚添加的 repo。
- 按确定。
- (可选)拉取后,您可能希望将任何新内容推送到服务器。