Lee*_*eem 5 java git github intellij-idea
我正在使用 Intellij IDE 开发 Java AWT 应用程序。在我 git 提交我的代码后,我推送到存储库:
me@mine-laptop myproject (master)$ git push origin master
Enumerating objects: 77, done.
Counting objects: 100% (77/77), done.
Delta compression using up to 4 threads
Compressing objects: 100% (58/58), done.
Writing objects: 100% (76/76), 114.51 MiB | 957.00 KiB/s, done.
Total 76 (delta 5), reused 1 (delta 0)
remote: Resolving deltas: 100% (5/5), done.
remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com.
remote: error: Trace: 41b3b658daba463dbc5ad37bce34f785
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File java_pid66619.hprof is 661.61 MB; this exceeds GitHub's file size limit of 100.00 MB
To github.com:myname/myproject.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@github.com:myname/myproject.git'
Run Code Online (Sandbox Code Playgroud)
它抱怨我有一个大文件java_pid66619.hprof
,但 git push 失败。
然后我将该文件添加到我的.gitignore
并再次推送,但仍然是相同的错误。
然后我运行 command ls -la
,我没有看到那个大文件java_pid66619.hprof
。我知道大文件是堆转储。
我的问题:
ls -al
但是 git sill 在推送时会抱怨它?先试试
git rm --cached java_pid66619.hprof
Run Code Online (Sandbox Code Playgroud)
至少,您的 .gitignore 将是有效的。
但是,如果在提交此删除后,推送仍然失败,则意味着(巨大的)文件是先前提交的一部分。
即使您删除并忽略一个文件,如果它是过去提交的一部分被推送,这也足以使所述推送操作因同样的原因失败。
那就试试
git filter-repo --path java_pid66619.hprof --invert-paths
Run Code Online (Sandbox Code Playgroud)
并强推。
这使用了 new newren/git-filter-repo
,它取代了BFG
和git filter-branch
我之前的提交是这个 repo 的第一次提交,它只是一个 README.md 文件
然后再次克隆存储库,将您的文件复制到新的本地克隆存储库中(减去,显然,巨大的存储库),添加、提交和推送。
归档时间: |
|
查看次数: |
2767 次 |
最近记录: |