繁体   English   中英

似乎无法从本地GIT存储库中删除

[英]Can't seem to be able to delete from the local GIT repository

我似乎不明白。 这个页面,我试图纠正提交中添加了大文件的构建文件夹的提交。

我已经从本地磁盘上删除了该文件夹。 我有:

$ git add -u
$ git commit

但是当我推送时,出现一个太大的文件错误,本地git中仍然有两个.pdb's 但是我再也看不到它们了:

$ git status

我已经做了:

$ git ls-tree --full-tree -r HEAD
The `.pdb` file or `Debug` folder is not on the list.

我已经尝试过各种可以在网上找到的内容,但是没有运气。 推动部分:

$ git push origin master

要不就

$ git push

和:

Counting objects: 499, done.
remote: warning: File project/Debug/CAD.pdb is 68.07 MB; this is larger than GitHub's recommended maximum file size of 50.00 MB
remote: warning: File project/Debug/vc141.pdb is 66.48 MB; this is larger than GitHub's recommended maximum file size of 50.00 MB
remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com.

然而,当:

$ git rm --cached -r ./project/Debug
fatal: pathspec './project/Debug' did not match any files

甚至:

$ git rm --cached ./project/Debug/CAD.pdb
fatal: pathspec './project/Debug/CAD.pdb' did not match any files

$ git commit -m "deleted files"

On branch master
Your branch is ahead of 'origin/master' by 2 commits.
  (use "git push" to publish your local commits)
nothing to commit, working tree clean

但是它一直在git push

使用git版本2.9.2.windows.1谢谢Dan。

git status表示您有2个不在origin/master提交。 其中一个必须添加文件,而另一个必须删除文件。

您可以通过运行git log --stat origin/master..master ,它显示了不在GitHub上的提交以及它们更改的文件名。

您可以通过运行git rebase -i origin/master并将第二行的开头从pick更改为squash ,将两个提交合并为一个,这意味着将稍后的提交压缩为较早的提交。

然后,尝试再次推动。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM