Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting gc.refLogExpire

Tags:

git

How do I set gc.reflogExpire so that items will never expire?
What other time interval formats does it accept?

The man page says that you can set it to "90 days or 3 months," but doesn't specify what format it expects.

like image 306
readonly Avatar asked Oct 14 '08 01:10

readonly


People also ask

What does git gc prune do?

git prune is used to remove Git objects that have been deemed inaccessible by the git gc configuration.

When should you not run git gc `? *?

auto below for how to disable this behavior. Running git gc manually should only be needed when adding objects to a repository without regularly running such porcelain commands, to do a one-off repository optimization, or e.g. to clean up a suboptimal mass-import.

What is the default setting of git Reflog?

By default, the reflog expiration date is set to 90 days. An expire time can be specified by passing a command line argument --expire=time to git reflog expire or by setting a git configuration name of gc.


2 Answers

Setting gc.refLogExpire to "never" should do the trick.

like image 130
CB Bailey Avatar answered Sep 18 '22 18:09

CB Bailey


I’m not sure where the format is documented, if at all, but git reflog uses the approxidate function from date.c to parse the expiry time. One of the possible values is “never.”

like image 31
Aristotle Pagaltzis Avatar answered Sep 18 '22 18:09

Aristotle Pagaltzis