Two questions:
Because... more detail :p
By (no branch), you might be asking about the reflog
rather than any given ancestry chain. The following has nothing to do with the branch you are on.
git log -g --pretty=oneline | tail -10
HEAD@{###}: action: summary (old)
HEAD@{###}: action: summary (older)
...
HEAD@{###}: action: summary (oldest)
-g
is --walk-reflogs
Instead of walking the commit ancestry chain, walk reflog entries.q|cut -d ' ' -f 2|tr -d ':' > log
to log only the reflog commit index.The following will show the earliest ancestors of the currently checked out branch.
git log --reverse --pretty=oneline | head -10 | cat -n
1 summary (oldest)
2 summary (second)
--reverse
Output the commits in reverse order.-n 10
or -10
since it breaks --reverse
cat -n
adds line numbers (commit index?)