find . -type f -not -path "./.git/*" -exec dos2unix {} \;
git commit -a -m 'dos2unix conversion'
2) Set
core.autocrlf
to input
on Linux/UNIX or true
on MS Windowns (repo or global)git config --global core.autocrlf input
3) [ Optional ] set
core.safecrlf
to true
(to stop) or warn
(to sing:) to add extra guard comparing if the reversed newline transformation would result in the same filegit config --global core.safecrlf true
B. Or per Repo Setup
1) Convert all to one format
find . -type f -not -path "./.git/*" -exec dos2unix {} \;
git commit -a -m 'dos2unix conversion'
2) add
.gitattributes
file to your repoecho "* text=auto" > .gitattributes
git add .gitattributes
git commit -m 'adding .gitattributes for unified line-ending'
dont worry about your binary files - git should be smart enough about them
沒有留言:
張貼留言