threads / bug / 15218

alternates, git prune, git-prune(1) bug

Subject: alternates, git prune, git-prune(1) bug

## tl;dr

One message between Aug 27, 2008 and Aug 27, 2008.

replies: 0people: 1as markdown or json

Bruce Stephens· Aug 27, 2008, 15:18 UTC · lore
The suggested command-line in git-prune(1) makes no sense:
EXAMPLE
       To prune objects not used by your repository nor another that
       borrows from your repository via its
       .git/objects/info/alternates:
           $ git prune $(cd ../another && $(git rev-parse --all))
It surely should have the nested $() removed:
           $ git prune $(cd ../another && git rev-parse --all)

But that doesn't really help if (as must be fairly common) the sharing repository contains objects not in the repository being pruned. In that case I just get "fatal: bad object: ..." for the first such object.

And now that "git gc" prunes, what's the recommended way to set this kind of thing up? I guess just not using alternates is the obvious one, and that would work OK for me, but for sites that want lots of sharing repositories (like git hosting sites) that wouldn't be so good. Can one set gc.pruneExpire to "never"? Ah, OK, that looks as though it'll work.

← back to recent threads