English 中文(简体)
合并远程分支的更改
原标题:Merge changes from remote branch
  • 时间:2012-05-23 08:59:19
  •  标签:
  • git

我开始学习吉特,我坚持 与一个问题。

假设有一个主仓库和两个叉子

师父

- & gt; fork1 - & gt; 我的本地克隆

- & gt; 叉2

I m working on one fork and I can pull changes from 师父 repository and merge them with my own. Now, let s say that some changes are made in one branch in second fork. How can I pull them and merge into my repo?

叉2 - & gt; 与我的本地克隆 - & gt; 推到叉1

另外,我是否可以在第二叉子中将(通过施用散列)从边远分支合并到第二叉子,以及如何合并?

谢谢你的回答

最佳回答

将叉口2 定义为叉口1 中的远程回购

git remote add fork2 /path/to/fork2/repo

然后从叉2 获取更改

git fetch fork2

从叉子2拉动更改。

git pull fork2 <branch name>

提醒您注意, 上面的命令将会更新您当前分支 。 所以您最好使用一个跟踪远程回邮, 并审查更改, 将其合并到您在叉1 中的分支, 如果您同意的话 。

git checkout --track -b branch_fork2 fork2/branch2

审查您本地分支中名为分支_fork2 的代码。

检查您想要合并叉子2 更改的位置的回邮 。

git checkout feature_1

那就合并起来吧

git merge branch_fork2

如果它导致合并冲突,解决合并冲突并造成冲突。

问题回答

暂无回答




相关问题
git confusion - cloning a repo is returning a past version

Im having some confusion with my git usage. I cloned a repo from one comp to the other, and the new clone is the state of the original that was active some time ago. So its cloning a past version. ...

Appropriate strategy for tagging and hotfixing with git

I was wondering if the strategy I m using for tagging and hotfixing tags (which then I use for deploying rails applications) with git is appropriate. For tagging I just tag a commit of the master ...

Tips on upgrading CVS to git/hg?

We still use CVS, I use git and hg for my personal use though I m still a novice at both, but I realize they re much more modern and better, faster, distributed, etc. It s just everyone is so ...

Using Git in a TFS shop

Using Git at home has spoiled me - I now find using TFS at work to be a bit of a drag and want to explore the possibility of using Git locally and syncing somehow with TFS. I figure there are a few ...

热门标签