Created
October 1, 2014 15:20
-
-
Save jrusbatch/a4bdc46fb6f95822e83c to your computer and use it in GitHub Desktop.
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 | |
if [ ! -d ".git" ]; then | |
echo "Directory is not a repository." | |
exit 1 | |
fi | |
if [ ! -f ".gitattributes" ] && [ -f "../gitattributes" ]; then | |
cp ../gitattributes .gitattributes && git add .gitattributes && git commit -m "Create .gitattributes" | |
git rm -r --cached . | |
git add . | |
git commit -m "Normalize line endings" | |
fi | |
if [ ! -f ".gitignore" ] && [ -f "../gitignore" ]; then | |
cp ../gitattributes .gitignore && git add .gitignore && git commit -m "Create .gitignore" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment