Skip to content

Instantly share code, notes, and snippets.

@dpwright
Created June 26, 2012 06:14
Show Gist options
  • Save dpwright/2993701 to your computer and use it in GitHub Desktop.
Save dpwright/2993701 to your computer and use it in GitHub Desktop.
Git alias to amend a specific commit earlier in the tree
amend-commit = "!f() { START=`(git symbolic-ref -q HEAD || git rev-parse HEAD) | cut -d"/" -f 3`; git checkout -q $1 && git commit --amend && git rebase --onto HEAD $1 $START; }; f"
@Ajedi32
Copy link

Ajedi32 commented May 23, 2013

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment