Last active
November 14, 2015 10:18
-
-
Save svdmitrij/b2f5459a3f42f3f600e1 to your computer and use it in GitHub Desktop.
Fix line endings problem when work on windows and linux (when lot of messages The file will have its original line endings in your working directory. warning: LF will be replaced by CRLF in...)
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 | |
# https://help.github.com/articles/dealing-with-line-endings/#refreshing-a-repository-after-changing-line-endings | |
git add . -u | |
git commit -m "Saving files before refreshing line endings" | |
git rm --cached -r . | |
git reset --hard | |
git add . | |
git commit -m "Normalize all the line endings" | |
# Now you can git reset --hard HEAD~2 if have two last commits or git reset --hard HEAD~1 if one. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment