Skip to content

Instantly share code, notes, and snippets.

@beck
Created March 30, 2017 17:34
Show Gist options
  • Save beck/8e81e582cffc3d819c9e805b4dafbfe2 to your computer and use it in GitHub Desktop.
Save beck/8e81e582cffc3d819c9e805b4dafbfe2 to your computer and use it in GitHub Desktop.
A git bin to auto fixup
#!/bin/sh
#
# git fixup - squash current changes into the last commit
#
# Stores the current the current head in 'doug/fixup'.
#
git branch -f doug/backup
git add -A
git commit --fixup head
GIT_EDITOR=: git rebase -i --autosquash head~~
echo
git diff doug/backup
echo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment