Skip to content

Instantly share code, notes, and snippets.

@alextercete
Last active February 3, 2017 11:26
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 alextercete/46d06968fd90a7237d9e2827aa1dc886 to your computer and use it in GitHub Desktop.
Save alextercete/46d06968fd90a7237d9e2827aa1dc886 to your computer and use it in GitHub Desktop.
Remove BOM from all text files tracked by Git
#!/bin/bash
git grep -I --name-only --null $'\xEF\xBB\xBF' | xargs -0 sed -i '1 s/^\xef\xbb\xbf//'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment