Skip to content

Instantly share code, notes, and snippets.

@erithmetic
Created October 26, 2011 19:29
Show Gist options
  • Save erithmetic/1317513 to your computer and use it in GitHub Desktop.
Save erithmetic/1317513 to your computer and use it in GitHub Desktop.
git amend
#!/bin/bash
if [ "$1" == "" ]
then
msg=`git log -n 1 --format=oneline | sed 's/^[0-9a-f]*[ ]//'`
else
msg="$1"
fi
git commit -m "$msg" --amend
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment