Skip to content

Instantly share code, notes, and snippets.

@nicoddemus
Last active August 3, 2017 19:52
Show Gist options
  • Save nicoddemus/9f3ff45e59b4cb1f884fa2dd4c1d2ecd to your computer and use it in GitHub Desktop.
Save nicoddemus/9f3ff45e59b4cb1f884fa2dd4c1d2ecd to your computer and use it in GitHub Desktop.
Normalize line endings in repository based on .gitattributes from etk
@echo off
if not exist ..\etk (
echo Could not find ..\etk
exit /b 1
)
copy ..\etk\.gitattributes .
if errorlevel 1 exit /b 1
git add .gitattributes
if errorlevel 1 exit /b 1
git commit -anm "Add .gitattributes file" --author "Dev"
if errorlevel 1 exit /b 1
git rm --cached -r .
if errorlevel 1 exit /b 1
git diff --cached --name-only -z | xargs -0 git add -f
if errorlevel 1 exit /b 1
git commit -nm "Normalize all line endings" --author "Dev"
if errorlevel 1 exit /b 1
echo Please push your changes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment