[英]Can't seem to be able to delete from the local GIT repository
I don't seem to be getting it. 我似乎不明白。 From this page I'm trying to correct a commit where I had added a build folder with large files.
从这个页面,我试图纠正提交中添加了大文件的构建文件夹的提交。
I've deleted the folder from the local disk. 我已经从本地磁盘上删除了该文件夹。 I've:
我有:
$ git add -u
$ git commit
But when I push, I get a too big file error, two .pdb's
are still in the local git. 但是当我推送时,出现一个太大的文件错误,本地git中仍然有两个
.pdb's
。 But I can't see them any longer with a: 但是我再也看不到它们了:
$ git status
I've done a: 我已经做了:
$ git ls-tree --full-tree -r HEAD
The `.pdb` file or `Debug` folder is not on the list.
I've tried every variation of what I can find on the web, no luck. 我已经尝试过各种可以在网上找到的内容,但是没有运气。 The push in part:
推动部分:
$ git push origin master
or just 要不就
$ git push
and: 和:
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.
Yet when: 然而,当:
$ git rm --cached -r ./project/Debug
fatal: pathspec './project/Debug' did not match any files
or even: 甚至:
$ 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
Yet it keeps showing up in the git push
. 但是它一直在
git push
。
using git version 2.9.2.windows.1 Thanks, Dan. 使用git版本2.9.2.windows.1谢谢Dan。
git status
says you have 2 commits that aren't in origin/master
. git status
表示您有2个不在origin/master
提交。 One of them must be adding the file and the other must be deleting it. 其中一个必须添加文件,而另一个必须删除文件。
You can check by running git log --stat origin/master..master
, which shows the commits that aren't on GitHub, and the filenames they change. 您可以通过运行
git log --stat origin/master..master
,它显示了不在GitHub上的提交以及它们更改的文件名。
You can combine the two commits into one by running git rebase -i origin/master
and changing the start of the second line from pick
to squash
, meaning squash the later commit into the earlier commit. 您可以通过运行
git rebase -i origin/master
并将第二行的开头从pick
更改为squash
,将两个提交合并为一个,这意味着将稍后的提交压缩为较早的提交。
Then, try pushing again. 然后,尝试再次推动。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.