At this point I feel like I've read every article online about core.autocrfl and the various ways to specify line endings in .gitattributes
, but I still can't really figure out what I need.
Our entire team develops on Windows, and our application is deployed to Linux. I want to control the whole policy using .gitattributes
so that no one has to worry about changing their settings. The current configuration of my .gitattributes
file is below, slightly modified from this git repo
We have a Java project and develop in Eclipse, so viewing files in LF endings isn't an issue. Currently, I am not positive, but I would imagine we have mixed endings in the repository.
My goal is:
Developers do not have to worry about changing settings in Git, etc.
Cloning the repository should not leave it in a modified state due to line ending changes automatically performed at checkout, thus asking the developer to commit a file he/she did not change
- Our Jenkins server is on Linux. When it clones the repository, it should also not have a modified state
I changed the .gitattributes
file to the below and deleted the index, and I now have over 3000 files pending commit due to the line endings. If I commit this, will my problems be solved going forward, and will my above requirements be met?
# Handle line endings automatically for files detected as text
# and leave all files detected as binary untouched.
* text=auto
#
# The above will handle all files NOT found below
#
# These files are text and should be normalized (Convert crlf => lf)
*.css text
*.df text
*.htm text
*.html text
*.java text
*.js text
*.json text
*.jsp text
*.jspf text
*.properties text
*.sh text
*.tld text
*.txt text
*.xml text
*.conf text
*.xsd text
*.jrxml text
*.vm text
*.prefs text
*.dtd text
*.crt text
*.key text
*.ccf text
*.prefs text
# These files are binary and should be left untouched
# (binary is a macro for -text -diff)
*.class binary
*.dll binary
*.ear binary
*.gif binary
*.ico binary
*.jar binary
*.jpg binary
*.jpeg binary
*.png binary
*.so binary
*.war binary
*.swf binary
*.bmp binary
*.doc binary
*.docx binary
*.dotx binary
*.pdf binary
*.xls binary
*.xlsx binary
*.xlsm binary
*.xltm binary
*.ttf binary