2017-08-15 33 views
1
git status 

所示:文件名太長:如何刪除?以下消息

lit/1252-a-comparison-between-neural-networks-and-other-statistical-techniques-for-modeling-the-relationship-between-tobacco-and-alcohol-and-cancer.pdf: File name too long 
On branch master 
Your branch is up-to-date with 'origin/master'. 
nothing to commit, working tree clean. 

該文件已被刪除,這是我可以用下面的命令確認:

git ls-files --deleted 

輸出:

lit/1252-a-comparison-between-neural-networks-and-other-statistical-techniques-for-modeling-the-relationship-between-tobacco-and-alcohol-and-cancer.pdf 

當嘗試刪除它與git ls-files --deleted | xargs git rm沒有效果,但我不能提交更改我的存儲庫,直到我刪除此文件。

我也試過使用:git config --system core.longpaths true但沒有成功。

我想知道如何解決這個問題?

+1

您是否嘗試過[混帳RM --cached(https://stackoverflow.com/questions/37279654/when-should-i-use-rm- git-rm-git-rm-cached-git-add)在這個文件上? –

+0

謝謝,這解決了我的問題。 – olyashevska

+0

@MattSlonetsky請提供您的評論作爲答案。 –

回答

1

git rm --cached是您正在查找的命令。

This answer給出了Git的新增更多詳情/刪除命令