Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我去了我的 github 存储库,发现我无意中将文件添加到了 msysgit,但有错字。我没有将文件添加到名为“域”的目录中,而是将它们添加到“域”中。
我尝试了 git mv,但路径在 Windows 中不区分大小写,并且移动失败。
解决此类问题的最佳方法是什么?
mv到别的东西,比如“tempdir”,然后mv回到正确的大写?
mv
回到历史记录 ( git checkout someHash),创建具有正确大小写的新目录,从错误的提交 ( ) 中签出文件git checkout someWrongHash someFiles,提交它们,然后将 HEAD 重置为新的提交。
git checkout someHash
git checkout someWrongHash someFiles
(下一次,不要在 Windows 上用 git 折磨自己;))