Skip to content

Instantly share code, notes, and snippets.

@jtwalters
Created April 22, 2014 01:13
Show Gist options
  • Save jtwalters/11162098 to your computer and use it in GitHub Desktop.
Save jtwalters/11162098 to your computer and use it in GitHub Desktop.
Ensure newline at EOF for all tracked files in a Git repository.
for file in `git ls-files`; do; file $file | grep ASCII > /dev/null && sed -i '' -e '$a\' $file; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment