2017-08-15 93 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的新增更多详情/删除命令