Skip to content

Instantly share code, notes, and snippets.

@karl82
Created May 18, 2017 19:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save karl82/984549af672618792ed4eaebe8726293 to your computer and use it in GitHub Desktop.
Save karl82/984549af672618792ed4eaebe8726293 to your computer and use it in GitHub Desktop.
# Better handling modified files
git status --porcelain --untracked-files=no| awk '/^.M/ { print $2;}' | while read file; do
hash=$(git log -n 1 --pretty=format:%h -- $file)
git commit --fixup $hash $file
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment