解决idea文件名称大小写导致GIT无法提交问题

北城余情 提交于 2020-04-30 20:21:49

在创建文件的时候不小心将文件名大小写错了

例:

创建:A.html  并且已经加入本地索引

修改文件名:A.html 为 a.html

commit 报错:

Commit failed with error:pathspec 'test/a.html' did not match any file(s) known to git.

解决方法:

在命令行执行: 

1. git status

On branch dev
Your branch is up-to-date with 'origin/dev'.

Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

        new file:   test/A.html

2.  git reset test/A.html

3. git add test/a.html

问题解决

参考:http://stackoverflow.com/questions/29485350/git-case-sensitivity-error-renaming-and-committing-from-android-studio/29485441#29485441

PS: 新版本IDEA已经修复此问题

 

 

 

 

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!