Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between git remote add and git clone

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?

like image 791
nacho4d Avatar asked Jan 31 '11 20:01

nacho4d


People also ask

What is the difference between git clone and git pull?

git pull is a (clone(download) + merge) operation and mostly used when you are working as teamwork. In other words, when you want the recent changes in that project, you can pull. The clone will setup additional remote-tracking branches.

What does git remote add mean?

The git remote add command will create a new connection record to a remote repository. After adding a remote, you'll be able to use as a convenient shortcut for in other Git commands. For more information on the accepted URL syntax, view the "Repository URLs" section below.

What is the difference between git clone and download?

When you download the repo it just gives you all the source files with no . git so you dont have the repo. When you clone you get a copy of the history and it is a functional git repo.

Does git clone set up remote?

The Git clone command will create a new local directory for the repository, copy all the contents of the specified repository, create the remote tracked branches, and checkout an initial branch locally. By default, Git clone will create a reference to the remote repository called origin .


1 Answers

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.

like image 144
Jason LeBrun Avatar answered Oct 12 '22 11:10

Jason LeBrun