Difference between git remote add and git clone

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Difference between git remote add and git clone相关的知识,希望对你有一定的参考价值。

http://stackoverflow.com/questions/4855561/difference-between-git-remote-add-and-git-clone

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.

 

These are functionally similar (try it!):

 # git clone REMOTEURL foo
and:

 # mkdir foo
 # cd foo
 # git init
 # git remote add origin REMOTEURL
 # git pull origin master
Now there are minor differences, but fundamentally you probably won‘t notice them. As an exercise left to the reader, compare the .git/config‘s from each directory.

  

 

以上是关于Difference between git remote add and git clone的主要内容,如果未能解决你的问题,请参考以下文章

python: the difference between append and extend

Difference between Netbios and Host name

Difference between hash() and id()

Difference between == and ===

The difference between UDS on IP and UDS on CAN

What's the difference between all the Selection Segues?