TortoiseGit, ignore line endings

2019-07-26 14:12发布

问题:

I am looking for a way to prevent TortoiseGit from flagging files as changed when they have Unix line endings. It is just tough to check if remote files have changed when you FTP download a folder, they show up as changed often because of the LF version that comes down. I'm on Windows, the repos are CRLF, but as I said when they change on the server they end up as LF.

回答1:

  1. Right click in that repository, TortoiseGit -> Settings
  2. Turn local AutoCrlf OFF and apply the setting

Extra ref.

Read Dealing with line endings - Per-repository settings,

then try Dealing with line endings - Refreshing a repository after changing line endings



回答2:

In my case all local files was showing change in newline chars. When I looked closely the 'CRLF' was converted to 'LF'. If I change the LF to CRLF manually, it was not working as in GIT repo it was showing it as difference in file. I also tried Yue's changes but while clicking on Apply button it was asking me windows hook file, that I do not had.

Then i realized that recently I had installed "cygwin" on my system. I was done using that, so I removed it and restarted system, and all my problems gone. My answer may help someone in my situation.



标签: tortoisegit