git replacing LF with CRLF

前端 未结 20 1721
眼角桃花
眼角桃花 2020-11-21 23:31

Running git on a Windows XP machine, using bash. I exported my project from SVN, and then cloned a bare repository.

I then pasted the export into the bare repositori

20条回答
  •  不思量自难忘°
    2020-11-22 00:12

    If you already have checked out the code, the files are already indexed. After changing your git settings, say by running:

    git config --global core.autocrlf input 
    

    you should refresh the indexes with

    git rm --cached -r . 
    

    and re-write git index with

    git reset --hard
    

    https://help.github.com/articles/dealing-with-line-endings/#refreshing-a-repository-after-changing-line-endings

    Note: this is will remove your local changes, consider stashing them before you do this.

提交回复
热议问题