Bitbucket:更新fork来合并主repo的更改? [英] Bitbucket: Update a fork to merge changes of master repo?

查看:508
本文介绍了Bitbucket:更新fork来合并主repo的更改?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用一个bitbucket git repo,我拥有只读访问权限,所以我创建了一个fork来处理我的功能。



问题:如何更新我的分支以包含对所有者所做的原始回购所做的更改?



在github上,似乎必须执行以下操作,因此我怀疑它与此类似:

  $ git remote add upstream git://github.com/octocat/Spoon-Knife.git 
$ git fetch upstream
$ git merge upstream / master

我无法在 Bitbucket分支文档

解决方案

与GitHub一样,您必须将提交下拉到您自己的机器上,合并,然后将它们推回到Bitbucket上的分支。

如果你在Bitbucket上进入你的分支,你可以点击比较分叉进入你看到传入和传出提交的页面。如果您转到传入选项卡,您将看到像

  $ git remote add< remote_name> git@bitbucket.org:< upstream> /< repo> .git 
$ git fetch< remote_name>
$ git checkout master
$ git merge< remote_name> / master

这与GitHub指令密切相关。


I am working with a bitbucket git repo I have read-only access to, so I created a fork to work on my features.

Question: How do I update my fork to include changes made to the original repo made by the owner?

On github, it seems one has to do the following, so I suspect it's a similar to this:

 $ git remote add upstream git://github.com/octocat/Spoon-Knife.git
 $ git fetch upstream
 $ git merge upstream/master

I couldn't find any information on this in the Bitbucket Documentation for forking

解决方案

Just like GitHub, you have to pull the commits down to your own machine, merge, and then push them back to your fork on Bitbucket.

If you go to your fork on Bitbucket you can click "compare fork" to get to a page where you see incoming and outgoing commits. If you go to the "incoming" tab, you will see instructions like

$ git remote add <remote_name> git@bitbucket.org:<upstream>/<repo>.git
$ git fetch <remote_name>
$ git checkout master
$ git merge <remote_name>/master

which correspond closely to the GitHub instructions.

这篇关于Bitbucket:更新fork来合并主repo的更改?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆