问题描述:

I am working on both Windows and Mac against a repo with origin on GitHub.

On GitHub, I want line-endings to be LF.

On Mac OS X, I want line-endings to be LF.

On Windows, I want line-endings to be CRLF -- except for a specific repo where I want LF.

Is this possible ?

网友答案:

I would suggest that on windows you run

git config --global core.autocrlf true

which will automatically translate to and from windows line endings

and then in specific repositories, which don't want conversion, you should run

git config core.autocrlf false

as you will notice git config has a --global property which modifies your ~/.gitconfig ( or C:\Users\.gitconfig ) file. Without this flag these settings are added to your repository.

See the git reference manual for a further explanation

相关阅读:
Top