7.2 Cloning a Remote Repository

Sharing your work with other developers means you need a remote repository. The easiest way to work with a remote repository is to clone an existing repository. Cloning creates a local copy of the remote repository.

For projects that are already in progress, this is the normal route, but it isn’t the only one. A remote repository can be configured later if you start working on a project by yourself and then need to share it. See Adding a Remote Repository Later for details.

Your local copy created by cloning works like it would if you had created it yourself using git init; the only difference is that you get the history of the repository up to the point you created the clone.

You use the git clone command ...

Get Pragmatic Version Control Using Git now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.