-1

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?

timebandit
  • 794
  • 2
  • 11
  • 26

2 Answers2

0

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

Community
  • 1
  • 1
joelschmid
  • 828
  • 1
  • 16
  • 32
  • If you found a duplicate, then please remember to flag this question as such as well, perhaps even leaving a comment. –  Jul 05 '14 at 18:29
0

With git clone you clone a complete repository, meaning, that you do not need to make any preparations.

With git remote add origin you add a remote repository to your existing repository. That means, there has to be an existing repository in the directory, you are currently in.

For the differences between git pull commands, look here

Community
  • 1
  • 1
toydarian
  • 4,246
  • 5
  • 23
  • 35