Customize how long normal reflog entries are retained.
Section: Safety and Maintenance
Set default reflog retention
bash
bash
git config --global gc.reflogExpire 90.daysExplanation
Longer reflog retention can improve recovery options in repositories with heavy history editing.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Safety and Maintenance
Set unreachable reflog retention
Control retention for entries that are no longer reachable.
Run aggressive pruning now
Force garbage collection and immediate pruning.
Inspect loose objects and packing state
Check repository object counts and size details.
Restore branch to a reflog entry
Move the current branch back to a previous recorded state.