Jason Sheh

Github push pre-receive hook declined error (actually not)


当我今天在push最新的修改时出现了一个错误。

通常我是使用GitKraken来进行git操作,它报了一个(pre-receive hook declined)的错。我就去google搜索相关解决方案,有的答案说是缺少push权限(适用gitbucket用户),有的说需要pull -rebase。都尝试过之后依然无法解决。

之后我又再命令重新push,问题原因就显而易见了。

C:\Code\SiteScan (master -> origin)
λ git push
fatal: HttpRequestException encountered.
   发送请求时出错。
Username for 'https://github.com': jasonsheh
Password for 'https://jasonsheh@github.com':
Counting objects: 42, d
one.
Delta compression using up to 4 threads.
Compressing objects: 100% (40/40), done.
Writing objects: 100% (42/42), 26.89 MiB | 3.55 MiB/s, done.
Total 42 (delta 23), reused 0 (delta 0)
remote: Resolving deltas: 100% (23/23), completed with 16 local objects.
remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com.
remote: error: Trace: 8c8685b2c2d3f109eb492ee65d9e3016
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File db/Rules.db is 111.76 MB; this exceeds GitHub's file size limit of 100.00 MB
To https://github.com/jasonsheh/SiteScan.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://github.com/jasonsheh/SiteScan.git'

github不能上传超过100mb大小的文件。

我又想了一下,我的组件识别的数据库文件只有5000多条决不可能超过100mb。该文件原来还存储了400万条ip数据,但我删除之后,文件大小并没有改变,sqlite还需要执行VACUUM命令释放空间。