Clarifying/clearing up line ending issues in GIT

前端 未结 2 1366
耶瑟儿~
耶瑟儿~ 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:40

    I would try, as much as possible, to standardise on a common line ending to be used throughout all source files in your project. A good one to choose might be LF only, however I would check that the editor(s) used by developers handle your chosen common line ending sanely and correctly. (In this case, sanely means not changing every line in the file just because the user changed one line.)

    You may need to do a big cleanup job and have one big commit that changes all the file line endings to your chosen standard ending. This will be awkward but probably not as awkward as maintaining a variety of different line endings.

提交回复
热议问题