Any way to perform an "autosquash" without actually squshing the commits (i.e. just reorder commits marked with --fixup
s.t. I can fix the merge conflicts prior to code review)?
Asked
Active
Viewed 281 times
1

User1291
- 7,664
- 8
- 51
- 108
-
If you need to reorder commits, won't `git rebase -i HEAD~N` work for you, where you just move the commits up and down? – mnestorov Aug 26 '19 at 12:06
-
@mnestorov Yes, but the point of using `fixup` and `autosquash` IS that I don't have to move the commits one-by-one myself. – User1291 Aug 26 '19 at 12:20
-
Sorry for the missunderstanding :) looking at the documentation, would `--no-autosquash` be of any use? – mnestorov Aug 26 '19 at 12:26
-
IIRC rebase -i reorders and sets up squashs with autosquash. You could then change the squashs to commits – D. Ben Knoble Aug 26 '19 at 12:39
1 Answers
2
No, there is not (at least not out-of-the-box). You could run a simple substitute command vim to replace all "fixup" or "squash" lines in the rebase script with "pick" (the default, i.e. create a new commit):
%s/^fixup\|^squash/pick/
You might map that to a keyboard shortcut in vim or store it in a macro, so that you are able to run it more quickly.

knittl
- 246,190
- 53
- 318
- 364