Git - 如何删除远程仓库中同名的两个文件夹之一

标签 git github directory

我在 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/

相关文章:

RStudio README.Rmd 和 README.md 都应该使用 'git commit --no-verify' 来覆盖这个检查

git - 如何从 master 向 staging 分支发出 pull 请求?

GIT:如何强制 merge 提交给祖先

xcode - Xcode4的版本控制如何使用Github

GitHub MarkDown : Are Macros and Variables possible?

android - android studio中布局的子文件夹

git - 在 Git 中列出冲突文件的最简单方法是什么?

html - 如何将 index.html 与 github 上的其他 .html 文件放在同一个文件夹中?

python - 什么时候需要使用 __init__.py?

windows - 有没有办法用 Java 锁定目录?