GIT EOL normalization script

This commit is contained in:
Jindra Petřík
2016-08-14 09:13:32 +02:00
parent 4d6b7f664e
commit 08582c495a

19
git_eol_normalization.bat Normal file
View File

@@ -0,0 +1,19 @@
git add . -u
@if %errorlevel% neq 0 goto failed
git commit -m "Saving files before refreshing line endings"
@if %errorlevel% neq 0 goto failed
git rm --cached -r .
@if %errorlevel% neq 0 goto failed
git reset --hard
@if %errorlevel% neq 0 goto failed
git add .
@if %errorlevel% neq 0 goto failed
git commit -m "Normalize all the line endings"
@rem No errorlevel check here - the commit can be empty
@goto okay
:failed
@echo "ERROR: Something FAILED"
@goto finish
:okay
@echo "SUCCESS"
:finish