0

preference to ignore or set fixed line endings and file permissions

UserXYZ 8 years ago updated by Marc Strapetz 8 years ago 3

I develop on Linux and windows the same code, so I don't really care what line endings are used where.

I do prefer to have Unix line endings everywhere because in Windows, my editor knows what to do about them but in Linux, it is better to get rid of Windows line endings.

So, I'd like to have a preference to enable one type of line ending that would be carried away to all copies of my code.

Even better option would be to have a logic that would somehow detect the line endings on the origin, and convert as I want it on local, automatically.

For example, if I create a repo and make some source files on Linux, then push it to GitHub for example, then clone it on Windows, it would be perfect if SmartGit would convert all line endings to CRLF on "download" and back to LF on "upload".

+1

So you have separate clones on Windows and Linux? Then Git's default line endings handling should do exactly what you want.

Well not really...because when I make some code on Windows and push it to remote, then sync on Linux and make some changes, push back and then pull it on Windows, SmartGit reports that they are different not only in content but also in line endings.

Even if I just push and pull same file from one side to another, it will also complain about line endings.

Now, I understand that some people find mixed CR and CRLF annoying etc, but I don't think that they should be important at all and so anyone should be able to choose how git and SmartGit should treat them - report as different, automatically convert or something else.


Same thing goes with file permissions - if I make a file executable on Linux, it will be remembered like that in git.

But, when I pull it in Windows, besides line endings, SmartGit also reports a difference because of file permissions and marks the file as changed, asking for a commit - instead of trying to preserve them or correct them according to the platform. It should also be a preference for the user to set...

Please post output of "git config -l | grep core" invoked in your Windows and your Linux repository.