与GitRe-perform合并之前进行 - Re-perform a merge that was previously conducted with Git

- 此内容更新于:2016-02-03
主题:

我有一个存储库是支改变(myChange1)。分支机构以来,发生了许多提交对开发分支(发展),和功能部门也经历了一系列的变化。最终的特性分支(myChanges1)合并回“发展”,为了添加一个文件。这导致了“开发”保持不变,除了这一个文件,点击进行合并;然后重置所需的所有文件,没有uncommitted-merge-changes,最后提交合并。我已经做了一些改变在“发展”,并希望re-perform之前进行了合并,将在特性分支上的所有特性(myChange1),但是当我再次尝试进行合并的“发展”,Git相信它已经进行了(它)和最终结果并不表现出的变化这一特性分支(myChange1),它只包含一个文件从最初的合并,和最新的“发展”。我怎么解决这个问题,最终得到一个工作集,包括“发展”,和整个分支的变化?有没有更好的方法做最初的合并吗?(使用源代码树,Bitbucket都进行的所有功能,通过UI)。

原文:

I have a repository which was branched for a change (myChange1). Since that branch a number of commits had happened against the development branch (develop), and the feature branch also underwent a series of changes.

Eventually the feature branch (myChanges1) was merged back in to 'develop', for the purpose of adding a single file. This resulted in 'develop' remaining unchanged, except for the addition of this single file, and was conducted by clicking merge; then resetting all the files that weren't needed in the uncommitted-merge-changes, before finally committing the merge.

I have since made a number of changes on 'develop', and would like to re-perform the previously conducted merge, to bring in all features on the feature branch (myChange1), however when I try to conduct the merge again on the head of 'develop', Git believes it has already been conducted (which it has) and the final result doesn't exhibit the changes of this feature branch (myChange1), it only contains the single file from the initial merge, and the newest state of 'develop'.

How do I resolve this problem, and end up with a working set that includes the head of 'develop', and the entire feature branch's changes?

Is there a better way to have done the initial merge at the time?

(Using Source Tree and Bitbucket, all functions where conducted via the UI).

网友:我试图添加一个文件不做合并(git可以处理这个问题在以后的合并)但是现在它所做的,我认为,出版和复制在其他地方,我刚刚重新合并为“真正的合并”(使它的一个新分支),尝试一些不同的方法来明白原来是最简单的吗?但我只知道如何使用命令行工具。

(原文:I would have tried to add the one file without doing a merge (git can handle this in the later merge) but now that it's done and, I assume, published and copied elsewhere, I'd just re-do the merge as a "real merge" (making a new branch for it), trying a few different methods to see what turns out to be the simplest—but I only know how to do this with command line tools.)

网友:谢谢你的反馈torek。我试着成堆的分支的不同组合,文件,和合并,但一直通过UI导致相同的结果。我不想详细说明他们在我的问题太多,以避免混乱。

(原文:Thanks for the feedback torek. I tried heaps of different combinations of branching, touching files, and merging, but kept resulting in the same outcome via the UI. I didn't want to elaborate on them too much in my question to avoid confusion.)

网友:我最终只是手动打开两个版本和更新文件,但形势将不可避免地在未来重现。我猜外卖,我只是需要学习Git(命令行工具)正确-我已经被命令的不一致,旗帜,和语法,就像大部分unix世界,我还没有写我自己。再次感谢!

(原文:I ended up just opening both version and updating the files manually, but the situation will inevitably resurface in the future. I guess the take-away is that I just need to learn Git (the command line tool) properly - I've been really put off by the inconsistency in the commands, flags, and syntax; like much of the unix world that I haven't authored myself. Thanks again!)