Little bit confused..
In the git community manual, it says
The git log command can show lists of
commits. On its own, it shows all
commits reachable from the parent
commit; but you can also make more
specific requests
$ git log v2.5.. # commits since (not reachable from) v2.5
I thought git log by itself only shows you the commits made to the current branch, and the commits are sequential – so how can you have one commit made since another, but unreachable from it?
I think I’m either misuderstanding what git log does or what unreachable means or both.. grateful for any help!
in Git, every commit you make (except for the very first) will have a parent commit. It follows that any given commit (except the first) is a child of one (or possibly more than one) other commit. You can also have several branches of development in Git, that begin or deviate at a particular ancestral commit. Nothing in Git dictates that commits must occur in either a chronological or linear order, and thus the
git logtool needs to be able to deal with several ways of querying history.For instance, assume I develop my application and make commits in alphabetical order:
In this example, I must have made a new branch on commit A and E.
If I were to run
git log <D>(where<D>is the commit’s SHA), then the log history would look like this:From that commit, only the parents and their ancestor commits can be ‘seen’. Commits B, E, F and G are technically ‘unreachable’ from commit D, as they share no common connected parent commit.