Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
git:删除远程存储库中已在本地存储库中删除的文件_Git_Macos_Github_Bitbucket_Case Sensitive - Fatal编程技术网

git:删除远程存储库中已在本地存储库中删除的文件

git:删除远程存储库中已在本地存储库中删除的文件,git,macos,github,bitbucket,case-sensitive,Git,Macos,Github,Bitbucket,Case Sensitive,远程存储库(bitbucket)中存在一些文件。但是,这些文件不再存在于本地存储库中 我猜它与以下命令有关: git config core.ignorecase false 我在意识到文件在我的计算机(OSX)中是正确的,但在Git存储库中是错误的(它们在本地存储库中是小写,但在远程存储库中是大写)之后执行了该命令。然后我执行: git add . && git commit -m "comment" git push origin master 不幸的是,存储库的大写文件

远程存储库(bitbucket)中存在一些文件。但是,这些文件不再存在于本地存储库中

我猜它与以下命令有关:

git config core.ignorecase false
我在意识到文件在我的计算机(OSX)中是正确的,但在Git存储库中是错误的(它们在本地存储库中是小写,但在远程存储库中是大写)之后执行了该命令。然后我执行:

git add . && git commit -m "comment"
git push origin master
不幸的是,存储库的大写文件没有变为小写。相反,存储库重复使用小写和大写文件

我执行了如下命令:

git diff master origin (it does not show anything, I guess because it does not detect any change).
git commit -a (no effect)
git add -u (no effect)

从远程更新本地存储库,删除大写文件(假设您希望在远程存储库中保留小写文件),从工作树和索引中删除文件,提交并将其推送到远程,如下所示:

git pull origin <remote> --rebase
rm <file-with-upper-case> //skip if file does not exist in local
git rm -f <file-with-upper-case>
git commit -m "Deleted Upper Case File"
git push origin <remote>
git pull origin--rebase
rm//如果本地文件中不存在文件,则跳过
吉特rm-f
git commit-m“已删除大写文件”
git推送原点

我就是这样解决这个问题的:

我下载了几个Git GUI。GitUp GUI显示了重复的文件,我不知道为什么:

我意识到只有两个文件夹有副本。因此,解决方案是:

  • 将这两个文件夹都移动到桌面(我使用OSX上的Finder;如果您使用Windows,则可以使用其文件资源管理器或任何其他GUI)
  • 使用Git添加并提交
  • 将两个文件夹移动到其原始位置
  • 再次使用Git添加并提交

它不是一个文件。有很多文件。。。我不确定哪些还没有更新。那么,有什么方法可以看到差异,因为diff不起作用?在切换到branch之后,您可以通过git命令检查diff-
git diff{upstream}
。我已经执行了
git diff{upstream}
。它不返回任何内容(我猜这意味着没有发现任何差异)