Skip to content

Instantly share code, notes, and snippets.

@polarblau
Last active August 29, 2015 13:57
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 polarblau/9594287 to your computer and use it in GitHub Desktop.
Save polarblau/9594287 to your computer and use it in GitHub Desktop.
Amend a commit with same message by default.
function gfix {
DEFAULT_MESSAGE=$(git log -1 HEAD --pretty-format:%s)
MESSAGE=${1:-$DEFAULT_MESSAGE}
git commit --amend -m "$MESSAGE"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment