What’s the difference between adding a remote repository and cloning a remote repository? I’m reading the pragmatic guide to git and they are talking about distributed environments and using git remote add. I’m finding the section difficult to understand, and why I should use it over clone.
Many thanks
Git clone sets up a new repository similar to the one you are cloning ( hence the name clone!) and “adds” the remote repository from which you cloned as the remote with the name
originJust doing the last part of setting up a remote is “adding a remote repository” and doing the whole thing and getting a new clone is cloning. Note that when you add a remote repository, you already have a repository. When you clone, you do not already have the repository.
A repository can have muliple
remotesadded to it viagit remote add. Usually these are remote repositories of the same repo’s clones on peers and servers with which you push and pull.