Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

git rewrite commit message

# for the most recent commit
git commit --amend -m "changed commits"
git push -f
# for n older commits
git rebase -i HEAD~n
# follow instuctions e.g. use r for reword to edit older commits
# removing a line means THAT COMMIT WILL BE LOST. 
git rebase --continue
# solve conflicts if exist
git push -f
# git push --force-with-lease origin <branch> is safer
Source by git-scm.com #
 
PREVIOUS NEXT
Tagged: #git #rewrite #commit #message
ADD COMMENT
Topic
Name
2+9 =