Muqito Muqito - 1 month ago 12
Git Question

Should the .gitattributes file be in the commit?

We're working on a project with a few people having a mac.

Me myself is running on windows.
We get some problems with the linebreaks.

I read on github that I could add this:

# Set default behaviour, in case users don't have core.autocrlf set.
* text=auto

# Explicitly declare text files we want to always be normalized and converted
# to native line endings on checkout.
*.c text
*.h text

# Declare files that will always have CRLF line endings on checkout.
*.sln text eol=crlf

# Denote all files that are truly binary and should not be modified.
*.png binary
*.jpg binary


into .gitattributes

But should I commit that file to github so the other people with mac get the same settings?

Please help me :o

If it matter's we're coding websites. (PHP, js files and stuff).

for the record, I'm the only one with Windows.. So yeah, what can I DO?

Answer Source

I added this:

# Set default behaviour, in case users don't have core.autocrlf set.
* text=auto

# Explicitly declare text files we want to always be normalized and converted 
# to native line endings on checkout.
*.c text
*.h text

# Declare files that will always have CRLF line endings on checkout.
*.sln text eol=crlf

# Denote all files that are truly binary and should not be modified.
*.png binary
*.jpg binary

and commited it to the github server. so everyone who had this fixed the problems.