I want to be able to touch up my commit messages before I push them to my remote, but I want to automatically do that.
I can reword all my additional commits by doin
Since the question is a bit vague on the nature of edits, these are just cues on what you could do.
I don't want to have to change every commit to reword.
You could change the editor used by git-rebase -i
with git config sequence.editor 'sed -i s/pick/reword/'
, so that no editor pops for the rebase-todo, and picks are replaced. But that's a bit clumsy because you have to cancel the config after. (there's also core.editor
for other cases, and $EDITOR
).
You can also run git rebase origin/master -x 'git commit --amend'
. -x
adds a exec
, line after each pick
in the rebase-todo. Note there's no -i
needed here. The amend will allow you to change the commit message, for example git commit --amend -m "new message"
.
I don't want to manually type in every commit I want to reword the message of.
You can use the EDITOR variable to a non-interactive command that edits in the way you want, but I don't know which kind of editing you want to do.
I want to rebase all the new commits with something other than pick
See previous answers.