Skip to content

Instantly share code, notes, and snippets.

@kerembaydogan
Last active April 20, 2021 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kerembaydogan/438018a679856bbda4cac52db6908f2f to your computer and use it in GitHub Desktop.
Save kerembaydogan/438018a679856bbda4cac52db6908f2f to your computer and use it in GitHub Desktop.
Change Commit Message Of Most Recent Commit (Already Pushed)
#If it is the most recent commit, you can simply do this in 2 steps:
git commit --amend -m "modified commit message" (amend message)
git push --progress origin --force (force push)
# Be careful using --force or -f! Bad things might happen...
# Force pushing is strongly discouraged since this changes the history of your repository.
# If you force push, people who have already cloned your repository will have to manually fix their local history.
# You can force push to a branch
# If you're absolutely sure that nobody else checked out the amended commit before your push.
# https://stackoverflow.com/questions/14381044/how-do-i-change-a-git-commit-message-in-bitbucket
# answered Mar 26 '18 at 0:29 naXa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment