Are CRLF lines ok in a Rails project deployed on Linux?

后端 未结 2 1337
时光取名叫无心
时光取名叫无心 2021-01-03 16:20

I have a Git repository (originally CVS, then SVN, now Git) containing a Rails project that has been deployed on Linux for a while now. Everything seems to run fine.

<
2条回答
  •  情书的邮戳
    2021-01-03 16:54

    If it is ok for you to rewrite your repository's history (see problems with rewriting history) you could use git filter-branch to convert CRLF to LF:

    git filter-branch --tree-filter 'find . -path './.git' -prune -o -type f -exec dos2unix \{} \;' HEAD
    

    Note that if you have binary files in your repository you will have to refine the find command to exclude them.

提交回复
热议问题