Distributed version control: why every Git clone holds the whole history

By Christophe Paka · Facts checked on 7 November 2026

You are on a train with no network, and you want to save your work. Or the host that stores your project closes its doors. With older tools, both are a problem, because every save goes through one server.

If that server is your only record, you cannot commit without it, and losing it means losing your past.

Git is distributed version control, and the figure below shows what that means in practice. Put the two models side by side, and you will see why you can commit anywhere and move hosts with no loss.

Centralized vs distributed. Left, SVN or CVS: one central server holds the full history and three checkouts hold none, so a commit needs the server. Right, Git: origin is a full repository, a peer, and three clones each hold the full history.
Figure 1.2: Every copy is the whole history. In the drawing, a peer is any full copy, and origin is the copy on your Git host. Fetch downloads its new commits; push uploads yours (chapter 5).
Use this diagram on your site

Free to share in your blog post, docs, course or slides, as long as the credit link stays. Paste the code below where the figure should go.

How to read this figure

  1. Start at the central server. On the left, older tools such as SVN (Subversion) and CVS use centralized version control. One server, a shared computer, holds the full history. Every save goes through it.

  2. Look at the three checkouts. Each person works in a checkout, SVN's name for its thin copy. The boxes say no history: the past lives on the server only. The note under them is the cost: a commit needs the server.

  3. Cross to origin on the right. In Git, origin is the copy on your Git host, such as GitHub or GitLab. It holds a full repository, but it is only a peer: one full copy among several, not the one true record.

  4. Read the three clones. A clone is a full copy of a repository. Each clone box says full history, because cloning copies every commit. So you read last year's versions without asking any server.

  5. Finish with the note at the foot. You commit and branch locally, then sync when you choose. Fetch downloads the host's commits; push uploads yours. See your copy, your photocopy, the host for how fetch and push work.

Key takeaways

  • Commit offline whenever you like, then push to your host when you have a network.
  • Treat origin as one peer, not the master record: every clone keeps every commit.
  • Keep a clone on a host or another computer, so deleting your .git folder never deletes your history.

Try this: clone once, then work with no network

You need Git installed with your name and email set, a network for the first step, and a terminal open outside any project.

  1. Clone GitHub's demo repository: git clone https://github.com/octocat/Hello-World.git, then cd Hello-World.
  2. Disconnect from the network.
  3. Read the history: git log --oneline. You see three commits, newest first, ending with 553c207 first commit.
  4. Make a commit: echo "offline note" > notes.txt, then git add notes.txt and git commit -m "Commit offline".
  5. Run git log --oneline again.

Expected result: Your commit sits on top of the three that came with the clone, and no server was asked. It stays in your clone until you push it to a host you can write to.

Questions readers ask

Is Git the same thing as GitHub?

No. Git is a free program on your computer that records every saved version. GitHub is a Git host, like GitLab, Bitbucket or Codeberg: a website that stores copies and adds sharing and review. You need a host only to share.

Can I use Git without an internet connection?

Yes. Every clone holds every commit, and nearly every command runs on your own computer. You commit, branch and read old versions offline. You need a network only to talk to a host, as with clone, fetch and push.

What happens to my code if my Git host shuts down?

Nothing is lost if anyone has a clone. Every clone still holds every commit, so you push it to another host and carry on with the full history.

Sources: Pro Git 1.3: What is Git? (git-scm.com); About Git (git-scm.com).

This figure is from Git Made Crystal Clear, chapter 1.

The chapter builds the idea step by step, with recipes you can follow, a Try it to check yourself, and every source.

Get the book

All diagrams