Dealing with files that Git refuses to reset?

后端 未结 2 1874
故里飘歌
故里飘歌 2020-12-18 07:47

I and my collegues are having terrible trouble getting git to behave properly with certain files on our Windows repostiory clones. The clones have been made by

相关标签:
2条回答
  • 2020-12-18 08:16

    The problem with this settings, as illustrated by the GitHub guide is an automatic conversion is done during the checkout of the repository...

    That means you do not need to open a file to trigger any change.

    Is it not possible to keep autocrlf to false, and open those Windows files in editors able to respect the return line characters?

    Note (illustrated here), if you need the conversion, except for some files, you could add a .gitattributes in the parent directory, with a:

    myFile -crlf
    

    In the file you set attributes to a path (or a pattern), or unset them (with the minus sign).
    The crlf attribute is the attribute which tells if a file is affected by the core.autocrlf options. If you unset it, Git won’t mess with the line endings in the file

    0 讨论(0)
  • 2020-12-18 08:29

    To solve this problem on my Windows 7 machine using git 1.7.3.1, I had to set the core.filemode option to false.

    git config -e --local
    
    0 讨论(0)
提交回复
热议问题