Reference logs, or "reflogs", record when the tips of branches and other references were updated in the local repository
git reflog
subcommands
git reflog show: shows the log of the reference provided in the command-line (or HEAD, by default). It is an alias for git log -g --abbrev-commit --pretty=oneline
git reflog expire: prunes older reflog entries.
git reflog delete: deletes single entries from the reflog
git reflog exists: checks whether a ref has a reflog
an example of git reflog show rollback4, in which rollback4 is a branch
As we can see, git reflog includes:
fast-forward merge: can see the commit it merge to
three-way merge commits: can distinguish whether conflicts or not from format
if commit (merge): commit_messages, then merge conflict
if merge SHA/branch: commit_message, then no merge conflict
What is git reflog?
Referred from git documents
git reflog
subcommands
git reflog show
: shows the log of the reference provided in the command-line (orHEAD
, by default). It is an alias forgit log -g --abbrev-commit --pretty=oneline
git reflog expire
: prunes older reflog entries.git reflog delete
: deletes single entries from the refloggit reflog exists
: checks whether a ref has a reflogan example of
git reflog show rollback4
, in whichrollback4
is a branchAs we can see,
git reflog
includes:commit (merge): commit_messages
, then merge conflictmerge SHA/branch: commit_message
, then no merge conflict