Should git change the ending of line? (control+M or ^M at the end of the first line)

前端 未结 3 1529
暗喜
暗喜 2021-02-05 18:46

I use git to pull my code from a windows machine.

When the other developers pull the files from the server on their liunx machine they have the

3条回答
  •  名媛妹妹
    2021-02-05 19:40

    This isn't a problem with GIT it's a problem with how the file was originally created/uploaded and stored. The best solution is finding an editor that allows you to set the end of line type to unix's.

    This seems to have a way to do it on the windows side with GIT, but I think that's a bad way to do it in general

    http://lostechies.com/keithdahlby/2011/04/06/windows-git-tip-hide-carriage-return-in-diff/

提交回复
热议问题