Last active
February 15, 2019 12:40
-
-
Save georgiyordanov/ea8c3daae004fa87ddf4111c3c353b7a to your computer and use it in GitHub Desktop.
Normalize all files in a git repo to LF
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Check current status | |
git diff 4b825dc642cb6eb9a060e54bf8d69288fbee4904 HEAD --name-only | xargs dos2unix -i -- | |
# Convert all files to LF and UTF-8 without BOM | |
git diff 4b825dc642cb6eb9a060e54bf8d69288fbee4904 HEAD --name-only | xargs dos2unix -r -- | |
# Check for tabs | |
git diff 4b825dc642cb6eb9a060e54bf8d69288fbee4904 HEAD --name-only | xargs grep -e "^\t" -- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment