2

We are working cross platform on Windows, Linux and Mac, we collaborate using GIT. Recently we stumbled upon autocrlf settings to avoid Carriage Return and Line Feed, and found out they show case different behavior on different platform.

We found a workaround to mark autocrlf = false. But every team mate has to change her setting on his machine.

My question is, Do we have some workaround by which we could check-in the autocrlf setting in the repo, so that user doesn't have to change her setting on its own? And the setting is automatically updated.

Anas Azeem
  • 2,820
  • 3
  • 24
  • 37
  • One hint: Configure the linefeeds in your appropriate IDE you are using, and not in git. – ckruczek Oct 07 '15 at 13:26
  • Seems like you might want to investigate [gitattributes](https://git-scm.com/book/en/v2/Customizing-Git-Git-Attributes). The `.gitattributes` file can specify exactly how to treat your text files. And best of all, the `.gitattributes` file is checked into the repo like any other source file. – Wolf Oct 07 '15 at 13:36

1 Answers1

0

Not possible to do this without forcing every user to update something in his settings.

See, e.g., here

What you could do is create server-side hooks that refuse commits in which line endings are changed, and informs the developer on how to correctly set up his git environment...

Community
  • 1
  • 1
BartBog
  • 1,889
  • 14
  • 28