Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/3.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
File Github,文件太大,已删除。_File_Github - Fatal编程技术网

File Github,文件太大,已删除。

File Github,文件太大,已删除。,file,github,File,Github,我有一个文件,我试图添加到我的回购,但超过了github的限制。不幸的是,我删除了它,但当我推它仍然试图添加它 rm dist/img/work.zip fatal: pathspec 'dist/img/work.zip' did not match any files 如何将其从回购中取出?使用 使用命令 git filter-branch --force --index-filter \ 'git rm -r --cached --ignore-unmatch dist/img/wo

我有一个文件,我试图添加到我的回购,但超过了github的限制。不幸的是,我删除了它,但当我推它仍然试图添加它

rm dist/img/work.zip
fatal: pathspec 'dist/img/work.zip' did not match any files
如何将其从回购中取出?

使用

  • 使用命令

    git filter-branch --force --index-filter \
      'git rm -r --cached --ignore-unmatch dist/img/work.zip' \
      --prune-empty --tag-name-filter cat -- --all
    
  • 筛选器分支完成后,请确认未丢失任何意外文件

  • 现在添加一个.gitignore规则

    echo dist/img/work.zip >> .gitignore
    git add .gitignore && git commit -m "ignore rule for files"
    
  • 现在推一下

    git push -f origin branch
    
  • 改编自: