将我的分叉与其他人的分叉合并

时间:2012-06-10 11:46:41

标签: git github

我在Github上分了一个回购,另一个人也把它分叉了 我想将其他人的分支合并到我的分支中 我该怎么办?

2 个答案:

答案 0 :(得分:4)

我想你有以下Github存储库:

如果您使用fork,那么您将拥有自己的fork的本地克隆克隆:

git clone git@github.com:you/yourfork.git

为了使用origin项目(和另一个fork),你必须添加相应的遥控器:

git remote add upstream http://www.github.com/mainuser/mainrepo.git
git remote add fork http://www.github.com/other/anotherfork.git

使用这些遥控器,您可以通过获取来获取远程信息:

git fetch upstream
git fetch fork

最后,您可以将工作与您的工作合并:

git merge fork/branch_you_want_to_merge

答案 1 :(得分:1)

你可能意味着branch而不是分叉。

git checkout your-branch
git merge other-guys-branch
相关问题