我在 github 上有一个存储库,其中有两个名称相同但内容不同的文件夹。我想删除其中一个文件夹。问题是,如果我在本地列出 repo 中的数据,则只有一个文件夹(包含我想保留的内容)。
显然在之前的提交中出了点问题。
关于如何删除其中一个文件夹而不删除另一个的想法?
最佳答案
is that if I list the data in the repo locally, there is only one folder (with the content I would like to keep).
那么 git status 可能会显示第二个,已删除。
或者您的操作系统无法加载它,因为它不区分大小写
将该删除注册到索引,提交并推送:
git rm --cached -r secondFolder/
git add -A .
git commit -m "delete folder"
git push
关于Git - 如何删除远程仓库中同名的两个文件夹之一,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44482128/