Difference between git remote add and git clone

nacho4d picture nacho4d · Jan 31, 2011 · Viewed 48.8k times · Source

What does the clone command do? Is there any equivalent to it in svn?

What is the difference between

git remote add test git://github.com/user/test.git

And

git clone git://github.com/user/test.git

Does the name of the created repo matter?

Answer

Jason LeBrun picture Jason LeBrun · Jan 31, 2011

git remote add 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.