Convert line-endings for whole directory tree (Git)

前端 未结 6 2169
爱一瞬间的悲伤
爱一瞬间的悲伤 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:18

    Here a solution if using sed:

    find . -type f -exec sed -i 's/\r$//' {} \;
    

    -i stands for in-place, if you want to create a backup as well use -i.bak

    's/\r$//' will replace all carriage returns(\r) at end of each line

提交回复
热议问题