19. A clone is the whole repository
Everything Git knows is in .git; clone copies every object, so a clone works offline and is a full repository; origin is only a remembered name for where it came from.

19. A clone is the whole repository

Everything Git knows is in .git; clone copies every object, so a clone works offline and is a full repository; origin is only a remembered name for where it came from.

It is the difference between Git and a checkout from a central server, and it frames every remote command.

Everything Git knows lives in one folder. Dot git. Every commit, every photo, every note.

Clone copies every object. Every commit, every photo, from the first one. Not just the latest files.

So you can read the history, make commits and branches, all without a network.

The place you cloned from is remembered under a name. Origin, by default. It is a remote. A repository somewhere else.

Both sides are full repositories. Neither is the master copy, except by agreement.

Check yourself. What does a clone contain that a downloaded zip of the files does not?

Do you like what you are reading? Subscribe to receive updates.

Unsubscribe anytime

Collaborators