Quantcast
Channel: Active questions tagged git-amend - Stack Overflow
Viewing all articles
Browse latest Browse all 30

How can I edit an old git commit message programmatically?

$
0
0

You can programmatically edit only the last commit message:

git commit --amend -m 'xxxxxxx'

Or a random commit interactively:

git rebase -i HEAD~n# Vim opens up, select the commit you want to modify, and change the word "pick" for "edit"git commit --amend -m "Changing an old commit message!"git rebase --continue

How do I combine both? I want to change a message programmatically, but to a prior commit, not just the last one.

The commit I want to modify has already been pushed to a git server, but having other people re-sync the git project is not a concern.


Viewing all articles
Browse latest Browse all 30

Latest Images

Trending Articles





Latest Images