10

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.

readonly
  • 343,444
  • 107
  • 203
  • 205

3 Answers3

11

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

git config gc.reflogExpire "never"
moodymudskipper
  • 46,417
  • 11
  • 121
  • 167
CB Bailey
  • 755,051
  • 104
  • 632
  • 656
8

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.”

Aristotle Pagaltzis
  • 112,955
  • 23
  • 98
  • 97
1

Setting in cli

  • day: git reflog expire --expire=180
  • never: git reflog expire --expire=never

Or

Setting this reflogExpire in you .gitconfig file

[gc]
    reflogExpire = never # Make reflog never expire
sunyunxian
  • 71
  • 4