I used a very bad log template and has issued git push for that commit. How can I modify or delete this log entry?
Share
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.
The answer depends on whether or not other people have pulled your commit. If they have, then you’re stuck with the bad template (or at least getting every local pull of the commit corrected probably isn’t worth your time). If others haven’t pulled it…
If it’s the most recent commit, you can use
git commit --amend.If it’s a commit a certain number in the past (call it commit
abcd1234), then you can usegit rebase:In the interactive screen, change
picktorewordfor that commit, and leave the rest the same. The rebase will continue to that commit, then pause, allowing you to reword the commit message.In either case, you’ll need to “force push” the rebased branch up: