I wrote an incorrect commit message, and I've pushed it to the remote. There are no small number of questions that already deal with this:
are just a couple. But they all seem to terminate with git push --force
, and the additional warning about why this is a bad idea - it edits the history, which means that everyone else who uses the repository suffers when they try to pull. They don't seem to say what the "right" thing to do is.
So what's the recommended or "correct" way to deal with this situation? I thought I could add an extra message with git commit --allow-empty
, but supposedly there is "rarely a good reason to do this". Is --allow-empty
indeed the right way to fix things? If not, what is the right way?
Note: Doing things the "right way" can involve "admitting I screwed up". As an example of what I'm looking for, the git tag
man page has a discussion on retagging pushed tags. It clearly discusses methods to re-tag incorrectly tagged commits, giving both a recommended course of action and a --force
-ish way of doing things.