I'm often rebasing interactive to make tiny changes in the history (for example removing a blank line, or editing one line). In most cases those changes are based on some peer review.
At first I do my change like that:
git rebase --interactive 83bbeb27fcb1b5e164318fa17c55b7a38e5d3c9d~
# replace "pick" by "edit" on the first line
# modify code
git commit --all --amend --no-edit
git rebase --continue
If there are merge conflicts in one of the following commits, I resolve them and do this:
git rebase --continue
# the commit message is shown, but does not have to be changed, so I just save and exit the editor
git rebase --continue
# the commit message is shown, but does not have to be changed, so I just save and exit the editor
git rebase --continue
# the commit message is shown, but does not have to be changed, so I just save and exit the editor
...
Is there anything like a --no-edit
argument to git rebase --continue
that avoids the editor (similar to git commit
)?
true
. Git will invoke it, it will do nothing and succeed, and Git will re-use the existing commit message. Hence:GIT_EDITOR=true git rebase --continue
. – Iatrics;
(like that:GIT_EDITOR=true;git rebase --continue
), but that did not work. (I'm using a mac, btw) – FmVAR=val cmd...
) does affect just the one command, plus anything it runs itself. To affect multiple commands you must set the variable and "export" it, which in most shells isexport VAR=value; command1; command2; ...
– Iatrics