English 中文(简体)
我在不把事情 me倒的情况下,如何使用“盖特重新基底——一”?
原标题:How do I use `git rebase -i` after `git merge` without messing things up?

我的情况如下:

  1. 我对我的当地存放处作出了一些承诺,然后将另一个分支(约150项承诺)大量并入主人。 它有许多冲突。

  2. 现在,我想把我所做的承诺推向后,然后再推进。

通常,我将使用<代码>rebase-i。

不幸的是,缺席行为是打破一股合并的共同点,我实际上又增加了150项承诺,将承诺分成另外一项(我的理解是,如果我使用重新基础,而不是从开始)——这是出于几个原因对我不利的行为。

I was very happy to discover the -p flag for rebase, which preserves merges. Unfortunately, this actually applied the same merge again and forgot all about my hard work in conflict resolving. Again—bad behavior!

是否有办法解决我想要的东西? 利用<代码>rebase——i,在重新排序或编辑具体承诺后不必重复我合并后的行动?

感谢!

最佳回答

rerere-train.sh。 我在评论中提到的文字确实如此——基本上它利用你的决议,只是让大家重新看到。 如果你愿意的话,你就能够以手工方式履行这一义务:

git checkout <parent of merge commit>
git merge <merged commit>         # if this goes cleanly, we re done
git rerere                        # done automatically if rerere.enabled is true
git checkout <merge commit> -- .  # check out the files from the result of the merge
git rerere                        # done automatically if rerere.enabled is true
git reset --hard                  # wipe away the merge

# and you d want to follow with git checkout <branch> to return to where you were

但是,你也可以仅仅制定<代码>rere.enabled,而且这些步骤与直接要求git rere——以及你今后将确定,只要你解决冲突,就自动运行。,这是我所讲的:

如果你想直接操作该书,你很可能想用如下论点来管理该书:rere-train.sh ^<commit before the mer> < Current Branch>。 (^commit notation means “don t path past this into the history”, so it得双双向,用于all. the joint commitments in their repo.

然而,如果你重新做事,那么,你就应该结束所记录的决议。 这就是说,你可以走下去,并做您的<代码>rebase -i,如果你陷入冲突,重新使用经核实的Resolution。 只是头脑:它仍然留下指数中标明冲突的文件,以便你能够检查这些档案,并确保它确实有意义。 如果你解决了冲突,则使用<条码>git 添加<>/条码>,以检查这些冲突,如你解决冲突,照旧!

git-re manpage载有对Rere的正常使用情况的非常小的长篇描述,其中并未涉及实际的re-所有自动进行。 这份说明没有强调:它都是以冲突为根据的,因此,即使冲突在完全不同的地方结束,只要冲突仍然是相同的文字冲突,它也可以重新使用一项决议。

问题回答

The I ve made a script to do this here。 See open issues for known limitations.

页: 1 在Fedora,可以采取以下措施:

    install "$(rpm -ql git|grep  /rerere-train.sh$ )" ~/bin

I used rere-train.sh fromuser @Je fromi swer. 然而,我有这个错误:

$ ../rerere-train.sh HEAD
C:Program FilesGitmingw64/libexec/git-core/git-sh-setup: line 6: .: git-sh-i18n: file not found

http://kernel. opensuse.org/cgit/kernel-source/commit/?h=linux-next&id=d52b9f00588bb18d7f7a0e043eea15e6c27ec40c”rel=“nofollow noreferer”> http://kernel.opensuse.org/cgit/kernel-source/commit/?h=linux-next&id=d52b9f00588bb187e7agc=627c 我看到这一点:

Michal Marek

The git-sh-setup helper has apparently never been meant to be used by scripts outside of git. This became apparent with git 2.10:

downloading anld edition - 2.3.4 便携式——我设法制作<代码>rere-train.sh。





相关问题
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 ...