reflog¶

For git-reflog(1).

Overview¶

Manage git reflog using GitReflogManager (collection-level) and GitReflogEntryCmd (per-entry operations).

Example¶

from libvcs.cmd.git import Git

git = Git(path='/path/to/repo')

# List reflog entries
entries = git.reflog.ls()

# List entries for a specific ref
head_entries = git.reflog.ls(ref='HEAD')

# Check if reflog exists for a ref
git.reflog.exists(ref='main')

# Expire old reflog entries
git.reflog.expire(ref='HEAD', expire='90.days.ago')

API Reference¶

class libvcs.cmd.git.GitReflogManager
¶

Bases: object

Traverse and manage git reflog entries with ORM-like filtering via QueryList.

class libvcs.cmd.git.GitReflogEntryCmd
¶

Bases: object

Run git commands targeting a specific reflog entry.

class libvcs.cmd.git.GitReflogEntry
¶

Bases: object

Represent a git reflog entry.