Howto handle "Too many unreachable loose objects"-warning

Magnus Granander February 7, 2013

Hi!

We currently switched to Stash from a standard Git repository. Stash has been handling our repository for about a month now and we are starting to se alot of warnings of this kind:

"warning: There are too many unreachable loose objects; run 'git prune' to remove them."

when pushing. As far as I can understand we want to run "git prune" and/or "git gc" in the repository that Stash has. My first thought was that there must be some maintenance setting available in Stash already, but I can't seam to find anything like that.

So, how do we handle this and get rid of the warning?

1 answer

1 accepted

0 votes
Answer accepted
cofarrell
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 7, 2013

Hi Mangan,

Are you seeing that error prefixed with 'remote: '? That is to say, do the Stash repostitories require repacking, or is it your local version?

If it's the latter you might just want to try running 'git gc' locally to see if that fixes it. If not, you can use the Stash Git Ops plugin which allows you to run 'gc' on Stash repositories via the UI:

https://marketplace.atlassian.com/plugins/com.atlassian.stash.plugin.stash-git-ops-plugin

I hope this helps.

Charles

Magnus Granander February 21, 2013

This was what I was looking for. Unfortunatally it didn't seem to solve the exact problem I am seeing, but beeing able to run clean up in a Stash repository is nice.

Like DrunkenMonkey likes this
MeijerYoung July 22, 2020

You could try with `--prune=now`  or run `git prune --expire=now` if you have that capability. 

 

It's a somewhat dangerous command though.  I came here looking for a safe alternative, but it doesn't seem there is one.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events