Clarifying/clearing up line ending issues in GIT

前端 未结 2 1354
耶瑟儿~
耶瑟儿~ 2021-02-08 20:13

We have a repository that was exported from subversion into git. This repository is used by Mac, Linux, and PC users. Needless to say the line endings are a mess. Some files end

2条回答
  •  无人及你
    2021-02-08 20:39

    This related SO question will be of interest to you:

    Trying to fix line-endings with git filter-branch, but having no luck

    And here is a link to similar advice from Github.

    Also, as mentioned in Greg Hewgill's post it is wise to verify that future committers use an editor which handles the new line-ending policy correctly.

    When you say "Adding autocrlf = true seems to fix things slightly." I assume this was done in using .gitattributes.

提交回复
热议问题