Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/21.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
Can';似乎无法从本地GIT存储库中删除_Git_Github - Fatal编程技术网

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

Can';似乎无法从本地GIT存储库中删除,git,github,Git,Github,我好像不明白。从中,我尝试更正一个提交,其中我添加了一个包含大文件的生成文件夹 我已从本地磁盘上删除该文件夹。 我已经: 但是当我推的时候,我得到了一个太大的文件错误,两个.pdb的仍然在本地git中。但我再也看不到他们了: $ git status 我做了一个: $ git ls-tree --full-tree -r HEAD The `.pdb` file or `Debug` folder is not on the list. 我已经尝试了我在网络上能找到的每一种变体,没有运气。推

我好像不明白。从中,我尝试更正一个提交,其中我添加了一个包含大文件的生成文件夹

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

但是当我推的时候,我得到了一个太大的文件错误,两个
.pdb的
仍然在本地git中。但我再也看不到他们了:

$ 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
以及:

然而,当:

$ 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推送中

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

git status
说你有两个提交不在
源代码/master
中。其中一个必须添加文件,另一个必须删除文件

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

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


然后,再次尝试推送。

两个ps我在谷歌上搜索了
提交
的内容,但没有人接近你写的内容。另外,我在本地根目录中放置了一个Visual Studio
.getignore
。应该在那里还是在
.git
文件夹中?我不想找出难处。:)
$ 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