Remote Repository Operations in Pictures
Let’s take a moment to visualize what happens during
clone and pull operations. A few
pictures should also clarify the often confusing uses of the same name
in different contexts.
Let’s start with the simple repository shown in Figure 11-1 as the basis for discussion.

Figure 11-1. Simple repository with commits
As with all of our commit graphs, the sequence of commits flows
from left to right and the master label points to the
HEAD of the branch. The two most recent commits are
labeled A and B. Let’s follow
these two commits, introduce a few more, and watch what occurs.
Cloning a Repository
A git clone command yields two separate repositories, as shown in Figure 11-2.

Figure 11-2. Cloned repository
This picture illustrates some important results of the clone operation:
All the commits from the original repository are copied to your clone; you could now easily retrieve earlier stages of the project from your own repository.
The development branch named
masterfrom the original repository is introduced into your clone on a new tracking branch namedorigin/master.Within the new clone repository, the new
origin/masterbranch is initialized to point to themasterHEADcommit, which isBin the figure.A new development branch called
masteris created in your ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access