Skip to content

Instantly share code, notes, and snippets.

@beck
Last active December 2, 2016 03:26
Show Gist options
  • Save beck/8a2b20c85e7931304dc122ffa9e17b66 to your computer and use it in GitHub Desktop.
Save beck/8a2b20c85e7931304dc122ffa9e17b66 to your computer and use it in GitHub Desktop.
git fixup
#!/bin/bash
#
# git fixup - squash current changes into the last commit
#
# Stores the current head in branch 'doug/fixup'.
#
git branch -f doug/fixup
git add -A
git commit --fixup head
GIT_EDITOR=: git rebase -i --autosquash head~~
echo
git diff doug/fixup
echo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment