threads / discuss / 16887

Fix commit message after push?

Subject: Fix commit message after push?

## tl;dr

2 messages between Dec 27, 2008 and Dec 27, 2008.

replies: 1people: 2as markdown or json

skillzero@gmail.com· Dec 27, 2008, 21:13 UTC · lore

Is there a way to fix a commit message after the commit has already pushed to someone else? I typed the wrong commit message then I pushed to the remote repository before realizing it. I tried git commit --amend to fix it in my local repository, but it rejects the subsequent push. I somewhat understand why it's rejecting it (my --amend rewrote history and now they are out-of-sync), but I was wondering if there is a general way to handle situations like this with git.

Miklos Vajna· Dec 27, 2008, 21:19 UTC · re: skillzero@gmail.com · lore

Re: Fix commit message after push?

On Sat, Dec 27, 2008 at 01:13:46PM -0800, skillzero@gmail.com wrote:
Show 8 quoted lines
> Is there a way to fix a commit message after the commit has already
> pushed to someone else? I typed the wrong commit message then I pushed
> to the remote repository before realizing it. I tried git commit
> --amend to fix it in my local repository, but it rejects the
> subsequent push. I somewhat understand why it's rejecting it (my
> --amend rewrote history and now they are out-of-sync), but I was
> wondering if there is a general way to handle situations like this
> with git.
git push -f
http://git.or.cz/gitwiki/GitFaq#head-c1dc263aca199d347f28872249e6c1f5d519a2df

← back to recent threads