从git中删除文件很困难

从git中删除文件很困难,git,Git,我一次又一次地按照说明操作,但文件没有被删除 fatal: pathspec 'build' did not match any files dac@dac-Latitude-E7450 ~/p/spaceworld> git rm --cached -r build/distributions/ fatal: pathspec 'build/distributions/' did not match any files dac@dac-Latitude-E7450 ~/p/spacewo

我一次又一次地按照说明操作,但文件没有被删除

fatal: pathspec 'build' did not match any files
dac@dac-Latitude-E7450 ~/p/spaceworld> git rm --cached -r build/distributions/
fatal: pathspec 'build/distributions/' did not match any files
dac@dac-Latitude-E7450 ~/p/spaceworld> git commit -m "refactored"
On branch master
Your branch is ahead of 'origin/master' by 5 commits.
  (use "git push" to publish your local commits)
Changes not staged for commit:
    modified:   .gradle/2.10/taskArtifacts/cache.properties.lock
    modified:   .idea/workspace.xml

Untracked files:
    .gitignore
    Effects/
    Textures/
    assets/Textures/3D/
    assets/Textures/BumpMapTest/
    assets/Textures/ColorRamp/
    assets/Textures/ColoredTex/
    assets/Textures/Cursors/
    assets/Textures/HdrTest/
    assets/Textures/Sky/
    assets/Textures/Terrain/
    build/

no changes added to commit
dac@dac-Latitude-E7450 ~/p/spaceworld> git push
warning: push.default is unset; its implicit value has changed in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the traditional behavior, use:

  git config --global push.default matching

To squelch this message and adopt the new behavior now, use:

  git config --global push.default simple

When push.default is set to 'matching', git will push local branches
to the remote branches that already exist with the same name.

Since Git 2.0, Git defaults to the more conservative 'simple'
behavior, which only pushes the current branch to the corresponding
remote branch that 'git pull' uses to update the current branch.

See 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
'current' instead of 'simple' if you sometimes use older versions of Git)

Username for 'https://github.com': montao
Password for 'https://montao@github.com': 
Counting objects: 889, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (844/844), done.
Writing objects: 100% (889/889), 214.55 MiB | 348.00 KiB/s, done.
Total 889 (delta 383), reused 0 (delta 0)
remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com.
remote: error: Trace: 0f0c9d2b284114de3032395332d440e1
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File build/distributions/spaceworld.zip is 150.17 MB; this exceeds GitHub's file size limit of 100.00 MB
remote: error: File build/distributions/spaceworld.tar is 154.00 MB; this exceeds GitHub's file size limit of 100.00 MB
remote: error: File build/assets/libs/assets.jar is 149.27 MB; this exceeds GitHub's file size limit of 100.00 MB
remote: error: File build/assets/libs/assets.jar is 136.69 MB; this exceeds GitHub's file size limit of 100.00 MB
To https://github.com/montao/spaceworld.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://github.com/montao/spaceworld.git'
dac@dac-Latitude-E7450 ~/p/spaceworld> git rm -r --cached build
fatal: pathspec 'build' did not match any files
dac@dac-Latitude-E7450 ~/p/spaceworld> ls build
assets/  classes/  dependency-cache/  distributions/  libs/  scripts/  tmp/
dac@dac-Latitude-E7450 ~/p/spaceworld> 
我提交了太多的文件,git使删除它们变得很困难。我能做什么

我再次尝试按照说明操作,出现了相同的错误

M   .idea/workspace.xml
dac@dac-Latitude-E7450 ~/p/spaceworld> git rm --cached -r build/distributions/
fatal: pathspec 'build/distributions/' did not match any files
dac@dac-Latitude-E7450 ~/p/spaceworld> git commit -m "refactored"
On branch master
Your branch is ahead of 'origin/master' by 5 commits.
  (use "git push" to publish your local commits)
Changes not staged for commit:
    modified:   .gradle/2.10/taskArtifacts/cache.properties.lock
    modified:   .idea/workspace.xml

Untracked files:
    .gitignore
    Effects/
    Textures/
    assets/Textures/3D/
    assets/Textures/BumpMapTest/
    assets/Textures/ColorRamp/
    assets/Textures/ColoredTex/
    assets/Textures/Cursors/
    assets/Textures/HdrTest/
    assets/Textures/Sky/
    assets/Textures/Terrain/

no changes added to commit
dac@dac-Latitude-E7450 ~/p/spaceworld> git push
warning: push.default is unset; its implicit value has changed in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the traditional behavior, use:

  git config --global push.default matching

To squelch this message and adopt the new behavior now, use:

  git config --global push.default simple

When push.default is set to 'matching', git will push local branches
to the remote branches that already exist with the same name.

Since Git 2.0, Git defaults to the more conservative 'simple'
behavior, which only pushes the current branch to the corresponding
remote branch that 'git pull' uses to update the current branch.

See 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
'current' instead of 'simple' if you sometimes use older versions of Git)

Username for 'https://github.com': montao
Password for 'https://montao@github.com': 
Counting objects: 889, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (844/844), done.
Writing objects: 100% (889/889), 214.55 MiB | 922.00 KiB/s, done.
Total 889 (delta 383), reused 0 (delta 0)
remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com.
remote: error: Trace: d05f62b01f57f07531635f28bda11733
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File build/distributions/spaceworld.zip is 150.17 MB; this exceeds GitHub's file size limit of 100.00 MB
remote: error: File build/distributions/spaceworld.tar is 154.00 MB; this exceeds GitHub's file size limit of 100.00 MB
remote: error: File build/assets/libs/assets.jar is 149.27 MB; this exceeds GitHub's file size limit of 100.00 MB
remote: error: File build/assets/libs/assets.jar is 136.69 MB; this exceeds GitHub's file size limit of 100.00 MB
To https://github.com/montao/spaceworld.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://github.com/montao/spaceworld.git'
dac@dac-Latitude-E7450 ~/p/spaceworld> 
注意:用文件名或文件类型替换*.sql。请非常小心,因为这将通过每次提交并删除此文件类型。

请尝试

安装后的单行命令:

$ java -jar bfg.jar --strip-blobs-bigger-than 100M spaceworld.git

在运行master之前,我也会隐藏更改或重新设置其基础

你想达到什么目标?取消跟踪
build
dir?如果是这样,它是未跟踪的。@Blackus但是当我尝试
git push
时,它抱怨
构建
dirI get
无法重写分支:您有未老化的更改。
那么您有未提交的文件。我认为,与其对所有不立即起作用的事情投否决票,不如支持并解决一些其他问题。首先,你是在一家新的分公司还是什么的?你是从总店来的吗?你有没有把这些文件推到回购协议上?是什么阻止了你删除当前的设置,再次初始化回购协议,并删除一个新的副本?这难道不是小事吗?我被困在这里好几个小时了,我只想删除文件。当我可以编写程序但不能使用git时,感觉就像白痴学者一样。相信我,我已经做到了。Git需要一些时间来适应。您可以投资一个GUI程序,以便更容易地查看Git分支和文件。我要做的是:创建一个新分支并签出该新分支。然后,我会将当前所有更改提交到新分支。然后我会试着运行我粘贴在原始评论中的脚本。如果我必须安装一个程序来删除一个文件,这感觉就像是白痴学者。也许是这样,但这会用一行代码自动处理各种历史记录和缓存修剪。另外,仅供参考,仅仅因为它们不适合你,就对每个答案进行否决通常是不好的。他们可能为别人工作。保留对错误答案或简单错误答案的向下投票。^我同意brandonscript。不要在一切都不适合你的时候就否决它。否则,没有人会帮助你。我向你保证,我们发布的解决方案适用于其他情况。我想说的是,这应该是微不足道的。我只想删除一个文件。
$ java -jar bfg.jar --strip-blobs-bigger-than 100M spaceworld.git