Git merge - Resolve git rebase conflicts the same way they were resolved previously

De openkb
Aller à : Navigation, rechercher

Sommaire

Questions

http://stackoverflow.com/q/645450/850848 http://stackoverflow.com/q/645450/850848

The "newroot" branch ended up with files exactly matching the root commit of the "master" branch.

Now I want to rebase the "master" branch onto the "newroot" orphan branch, like:

git rebase --onto newroot --root master

The problem is that I get prompted to resolve all merge conflicts. There are hundreds of merges over a span of many years. I m just not capable of resolving them manually. And there s really no need, as these merges were already resolved in the past. As the rebase actually does not change contents (as I m rebasing on an identical tree), I want Git to "replay the merge" exactly.

 Is there a way to specify that the rebase should use the same resolution as was used previously?  

I understood that the "rerere" may help here. But I would had to have it enabled already, when originally merging, right? Or can I retrospectively recreate the "rerere" cache?


I can imagine an alternative solution to my task. To somehow ask Git to concatenate the "newroot" and "master" branches, without actually rebasing. But I m not sure if that s possible.

Answers

To somehow ask Git to concatenate the "newroot" and "master" branches, without actually rebasing. But I m not sure if that s possible.

https://git-scm.com/docs/git-filter-branch https://git-scm.com/docs/git-filter-branch http://stackoverflow.com/q/6088551/6309 http://stackoverflow.com/q/6088551/6309

On the rebase side, you can try and use a merge strategy like theirs, to resolve any conflict using the master branch content (since master is being rebased)

git rebase --merge -s recursive -X theirs --onto newroot --root master

Source

License : cc by-sa 3.0

http://stackoverflow.com/questions/38092355/resolve-git-rebase-conflicts-the-same-way-they-were-resolved-previously

Related

Outils personnels
Espaces de noms

Variantes
Actions
Navigation
Outils