Yoke Keong

Handling line endings on Windows with git

Note to self: When collaborating on different platforms, one of the most common issue is line endings - LF on Mac/Linux and CRLF on Windows. With git, you can address this issue in the following ways:

1) Configure Global Settings

  1. Windows users: git config --global core.autocrlf true
  2. Mac/Linux users: git config --global core.autocrlf input

2) Configure Per-repository settings

1echo "* text=auto" > .gitattributes
2git add .
3git commit -m "Files play nice in Mac, Linux and Windows"
4git push origin master

Additional reading: StackOverflow thread Github help

<< Previous Post

|

Next Post >>

#Git