由于我已经删除了一个大文件而无法将其推送到GitHub

时间:2019-04-19 15:24:48

标签: git github

我刚刚开始使用git和GitHub。我试图推送一个大文件并收到错误消息。因此,我删除了该文件,但是即使该文件不存在,我仍然收到相同的错误消息。

我读过其他文章,建议使用下面代码部分第一行中显示的git filter-branch命令。

我尝试将目录和文件名放入命令的文件/目录部分,并执行了命令而没有错误。但是,我仍然遇到相同的错误。除此以外,我找不到其他解决方案。它似乎为他人工作。我不明白为什么它对我不起作用。

#command that works for others
git filter-branch --index-filter 'git rm -r --cached --ignore-unmatch <file/dir>' HEAD

MAC OS Terminal
#I enter & execute command
 $git filter-branch --index-filter 'git rm -r --cached --ignore-unmatch <pagerank>' HEAD
Rewrite 02d20ace05b2327ae69832d94d8e22f222cd3700 (1/7) (0 seconds passed, remaining 0 predicted)    /usr/local/git/libexec/git-core/git-filter-branch: eval: line 425: syntax error near unexpected token `newline'
/usr/local/git/libexec/git-core/git-filter-branch: eval: line 425: `git rm -r --cached --ignore-unmatch <pagerank>'
index filter failed: git rm -r --cached --ignore-unmatch <pagerank>

#git status and push
$git status
On branch master
Your branch is ahead of 'origin/master' by 4 commits.
  (use "git push" to publish your local commits)

nothing to commit, working tree clean
Robs-MacBook-Pro:Git_repo 

$ Git push -u origin master
Enumerating objects: 27, done.
Counting objects: 100% (27/27), done.
Delta compression using up to 4 threads
Compressing objects: 100% (25/25), done.
Writing objects: 100% (26/26), 156.52 MiB | 6.30 MiB/s, done.
Total 26 (delta 3), reused 1 (delta 0)
remote: Resolving deltas: 100% (3/3), done.
remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com.
remote: error: Trace: 475810e9f982012443b42937b517e5db
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File Pagerank/spider.sqlite is 784.58 MB; this exceeds GitHub's file size limit of 100.00 MB
To https://github.com/resonates7/Repo_1.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://github.com/resonates7/Repo_1.git'


我想了解正在发生的事情,因此我可以调试未来的问题并将文件成功推送到github。我真的不需要在那里保存大文件。预先感谢所有真正聪明的人的帮助。

0 个答案:

没有答案