Git · Maintenance

git reflog expire

Trims old reflog entries. Be careful: this removes a recovery path.

Syntax
git reflog expire --expire=30.days

Example

Example
git reflog expire --expire=30.days --all

More in this group

git count-objects -v git filter-repo git fsck --lost-found git gc git lfs git maintenance git prune git repack

Learn this in the course

Reference pages are the quick answer. The course explains the why, shows the full example and ends with a challenge.

Open the course