我正在使用Intellij IDE开发一个Java AWT应用程序。在我提交了代码之后,将其推送到仓库:
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'
报错说我有一个大文件java_pid66619.hprof
,导致git push失败。
然后我将这个文件添加到我的.gitignore
中并再次push,但仍然出现相同的错误。
接着我运行ls -la
命令,但是我没有看到那个大文件java_pid66619.hprof
。我知道这个大文件是堆转储。
我的问题:
- 为什么我用
ls -al
看不到那个文件,但是git在push时还是会抱怨它? - 为什么我已经在git中将它忽略了,但仍然会被抱怨?
- 如何解决这个问题?
.gitignore
只会忽略未跟踪的文件。