Skip to content

Instantly share code, notes, and snippets.

@caugner
Last active June 18, 2018 07:42
Show Gist options
  • Save caugner/acd33852272493278e3fb49e3db2c788 to your computer and use it in GitHub Desktop.
Save caugner/acd33852272493278e3fb49e3db2c788 to your computer and use it in GitHub Desktop.
`git commit --fixup` all changes per file to the last commit of the file
#!/usr/bin/env bash
gfxpf() {
git reset
for file in $(git ls-files --modified)
do
git add $file
git commit --fixup=$(git log -1 --pretty=format:%h $file)
done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment