Skip to content

Instantly share code, notes, and snippets.

@willnode
Last active June 30, 2018 02:41
Show Gist options
  • Select an option

  • Save willnode/a6e76fcb9ac5d150df4a356b818a0ffe to your computer and use it in GitHub Desktop.

Select an option

Save willnode/a6e76fcb9ac5d150df4a356b818a0ffe to your computer and use it in GitHub Desktop.
Normalize Line Ending in 1..2..3 (normalize == Platform Dependant) (normalize-lf == Force LF)
@echo off
REM DO NOT USE THIS INSIDE THE FOLDER WHICH ALREADY HAS .GIT REPO
IF EXIST .git (
echo THERE'S A .GIT FOLDER!!! Aborting.
) ELSE (
git init
echo * text=auto eol=lf>.gitattributes
git add -A
git commit -m "Init the Dummy"
git rm --cached -r .
git reset --hard
del /Q /F .gitattributes
RD /S /Q .git
)
if [ ! -d ".git" ]; then
git init
echo * text=auto eol=lf>.gitattributes
git add -A
git commit -m "Init the Dummy"
git rm --cached -r .
git reset --hard
rm -rf .gitattributes
rm -rf .git
fi
@echo off
REM DO NOT USE THIS INSIDE THE FOLDER WHICH ALREADY HAS .GIT REPO
IF EXIST .git (
echo THERE'S A .GIT FOLDER!!! Aborting.
) ELSE (
git init
git add -A
git commit -m "Init the Dummy"
git rm --cached -r .
git reset --hard
RD /S /Q .git
)
if [ ! -d ".git" ]; then
git init
git add -A
git commit -m "Init the Dummy"
git rm --cached -r .
git reset --hard
rm -rf .git
fi
@willnode

Copy link
Copy Markdown
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment