What are the differences between & ldquo; Git clone & rdquo; And & ldquo; Git remote add & rdquo;

advertisements

This question already has an answer here:

  • Difference between git remote add and git clone 3 answers

These two seem to be equivalent:

git clone <remote-url> .
git pull

git remote add origin <remote-url>
git pull origin master

What are the differences?


git remote add origin just creates an entry in your git config that specifies a name for a particular URL. You must have an existing git repo to use this.

git clone creates a new git repository by copying an existing one located at the URI you specify.

Duplicate: Difference between git remote add and git clone