码迷,mamicode.com
首页 > 其他好文 > 详细

Difference between git remote add and git clone

时间:2017-03-21 12:25:38      阅读:194      评论:0      收藏:0      [点我收藏+]

标签:ted   pull   spec   git init   git pull   com   existing   log   and   

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

标签:ted   pull   spec   git init   git pull   com   existing   log   and   

原文地址:http://www.cnblogs.com/mysic/p/6593600.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!