Convert line-endings for whole directory tree (Git)

前端 未结 6 2170
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-04 04:26

Following situation:

I\'m working on a Mac running OS X and recently joined a project whose members so far all use Windows. One of my first tasks was to set up the c

6条回答
  •  心在旅途
    2020-12-04 05:17

    On OS X, this worked for me:

    find ./ -type f -exec perl -pi -e 's/\r\n|\n|\r/\n/g' {} \;
    

    Warning: Please backup your directory before executing this command.

提交回复
热议问题