當(dāng)代碼從windows直接復(fù)制到Linux或者M(jìn)ac的時(shí)候,使用git status命令會(huì)發(fā)現(xiàn)所有的文件都紅了,然后用git diff后發(fā)現(xiàn)每一行后面都會(huì)多出一個(gè) ^M ,之后判斷是換行符引起的問題。
使用命令解決:
git config --global core.autocrlf input
當(dāng)代碼從windows直接復(fù)制到Linux或者M(jìn)ac的時(shí)候,使用git status命令會(huì)發(fā)現(xiàn)所有的文件都紅了,然后用git diff后發(fā)現(xiàn)每一行后面都會(huì)多出一個(gè) ^M ,之后判斷是換行符引起的問題。
使用命令解決:
git config --global core.autocrlf input