I stupidly pushed a commit to GitHub with a very messed up commit name. How do I change this?
Does git commit --amend still work for already pushed commit?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
which will bring up your editor, or
which will allow you to specify the new message on the command line. Also possible, but more useful if you have other commits to reword
Because this commit has a new SHA1 due to the change of the contents, you will need to force push the new reference. The force is needed because it tells git to forget about the previous commit. It’s a safety measure.