Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2895797
  • 博文数量: 674
  • 博客积分: 17881
  • 博客等级: 上将
  • 技术积分: 4849
  • 用 户 组: 普通用户
  • 注册时间: 2010-03-17 10:15
文章分类

全部博文(674)

文章存档

2013年(34)

2012年(146)

2011年(197)

2010年(297)

分类: LINUX

2011-10-12 20:16:46

git init

初始化一个本地目录,加入版本管理

git clone

克隆一个版本库(repository)到一个新的目录,命令格式:

git clone [–template=] [-l] [-s] [–no-hardlinks] [-q] [-n] [–bare] [–mirror] [-o ] [-u ] [–reference ] [–depth ] [–] []

在clone后, 执行不带参数的git fetch的命令将更新远端的任何branches, 而执行不带参数的git pull的命令将merge远程的master branch到当前master branch

表示要clone的仓库名称,可以是本地或者远程的。仓库可以由以下几种表现方式:

rsync://host.xz/path/to/repo.git/ [:port]/path/to/repo.git/ [:port]/path/to/repo.git/ git://host.xz[:port]/path/to/repo.git/ git://host.xz[:port]/~user/path/to/repo.git/ ssh://[user@]host.xz[:port]/path/to/repo.git/ ssh://[user@]host.xz/path/to/repo.git/ ssh://[user@]host.xz/~user/path/to/repo.git/ ssh://[user@]host.xz/~/path/to/repo.git

其中ssh是默认协议,所以如果使用ssh协议可以不写ssh的协议名。

如果使用本地仓库,可以使用以下路径:

/path/to/repo.git/ file:///path/to/repo.git/

使用以上仓库路径,就相当于显式的使用了-l或-local参数。表示你本地的路径名,会将远程的仓库的内容clone这个目录里面。

参考:

阅读(989) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~