2

As hinted by answer https://stackoverflow.com/a/32025729 I've configured remote bare repo with

git config gc.pruneExpire never
git config gc.reflogExpire never

and as a result, I always keep all stored commits of all branches and tags ever even if I do not invent permanent branch names or tags for all those commits.

However, this will cause following warning to appear in long run:

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

This is caused by the fact that the dangling commits that I want to keep forever are always stored as loose objects.

Is there a nice way to get git to include dangling commits referenced only by reflog in pack files on purpose? That would allow performance to keep high and not lose unnamed history.

I know that I can workaround the warning by setting gc.auto to some really high number but that will cause (minor?) performance problem in the long run.

Mikko Rantalainen
  • 11,523
  • 10
  • 66
  • 98

0 Answers0