Git - Different Platforms

Advertisements


GNU/Linux and Mac OS use line-feed (LF) or new line as line ending character while Windows uses line-feed and carriage-return (LFCR) combination to represent line ending character.

To avoid unnecessary commits because of these line ending differences, we have to configure Git client to write the same line ending to the Git repository.

For Windows system, we can configure Git client to convert line endings to CRLF format while checking out and convert them back to LF format during commit operation. Below settings will do the needful.

[tom@CentOS project]$ git config --global core.autocrlf true

For GNU/Linux or Mac OS, we can configure Git client to convert line endings from CRLF to LF while performing checkout operation.

[tom@CentOS project]$ git config --global core.autocrlf input


Advertisements
Advertisements