Pushing to Bitbucket Server reports there are too many unreachable loose objects


アトラシアン コミュニティをご利用ください。


プラットフォームについて: サーバーと Data Center のみ。この記事は、サーバーおよび Data Center プラットフォームのアトラシアン製品にのみ適用されます。


When pushing to Bitbucket Server, the following message is written in Command Prompt / Terminal:

$ git push -f
Counting objects: 10, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (10/10), done.
Writing objects: 100% (10/10), 838 bytes | 0 bytes/s, done.
Total 10 (delta 7), reused 0 (delta 0)
remote: View pull request for package-generation => develop:
remote: https://mybitbucketinstance/projects/PROJ/repos/my-repo/pull-requests/261
error: The last gc run reported the following. Please correct the root cause
and remove gc.log.
Automatic cleanup will not be performed until the file is removed.
warning: There are too many unreachable loose objects; run 'git prune' to remove them.
To ssh://git@mybitbucketinstance/proj/my-repo.git
+ 71f8fbd...954cbcb package-generation -> package-generation (forced update)


  • The error is prefixed by "remote" indicating that the error was generated by the remote (i.e., by Bitbucket Server).
  • Running git prune (as suggested in the error message) does not help.


Garbage collection is being triggered when the client attempts to push to the server and this is failing due to the existence of the gc.log file; daemonized git gc now saves output to gc.log. Hence, subsequent executions of gc --auto will not run.

The push does succeed and does not prevent developers from working as normal.


  1. Determine the ID of the repository into which changes are being pushed

  2. <BITBUCKET_HOME>/shared/data/repositories/<repository_id> に移動します。
  3. Delete the gc.log file.
  4. git config --bool gc.autodetach false を実行します。


Upgrade to Bitbucket Server 5.0+ which provides enhancements to how Bitbucket Server handles garbage collection internally.

最終更新日 2018 年 11 月 2 日


Powered by Confluence and Scroll Viewport.