28

Git rerere provides for reuse of previous conflict resolutions during rebase, and can even stage the resolved files by setting rerere.autoupdate = True (as detailed in another question). However, even if all conflicts are resolved and all files staged, I still have to run git rebase --continue to continue the rebase operation.

How can I automatically continue if rerere has resolved all conflicts and staged all changes?

Community
  • 1
  • 1
frasertweedale
  • 5,424
  • 3
  • 26
  • 38
  • 3
    Another question has a nice answer http://stackoverflow.com/a/27513648/259946 – hazzik Jun 23 '15 at 04:11
  • I don't know if @frasertweedale meant the question this way, but I'm using `git rebase -i` in a script (with `GIT_SEQUENCE_EDITOR`). So not automatically continuing/skipping resolved conflicts is a PITA, because either I have to do it manually or emulate the nicety of `if ! git rebase […]; then git rebase --abort; fi` with lots of `git reset`, `git cherry-pick`, etc. and thus lots of opportunities to mess up. – Tim Landscheidt Dec 31 '16 at 08:23

2 Answers2

5

Rebase should use more the rerere-autoupdate from Git 2.14.x/2.15 onward (Q3 2017).

See commit f826fb7, commit 8d8cb4b, commit 6f0e577, commit 9b6d7a6, commit 5fb415b, commit fd4a3f4 (02 Aug 2017) by Phillip Wood (phillipwood).
(Merged by Junio C Hamano -- gitster -- in commit 1016495, 22 Aug 2017)

That is because now:

rebase: honor --rerere-autoupdate

Rebase accepts '--rerere-autoupdate' as an option but only honors it if '-m' is also given.
Fix it for a non-interactive rebase by passing on the option to 'git am' and 'git cherry-pick'.

rebase -i: honor --rerere-autoupdate

Interactive rebase was ignoring '--rerere-autoupdate'.
Fix this by reading it appropriate file when restoring the sequencer state for an interactive rebase and passing '--rerere-autoupdate' to merge and cherry-pick when rebasing with '--preserve-merges'.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • 2
    Note that this does not work for `rebase --continue`, i.e. you already need to specify it for the initial rebase command. – jmiserez Jul 19 '18 at 12:28
3

No. Rebase or Merge does not automatically provide a provision for auto-commits when conflicts arise. You could understand more about git merge here in 'merging' heading. git config also does not provide an option for auto commits while rebasing. Note that you could choose not-to commit while merging.

fundoopanda
  • 166
  • 1