git之clone
git clone 命令参数:

- usage: git clone [options] [--] <repo> [<dir>]
- -v, --verbose be more verbose
- -q, --quiet be more quiet
- --progress force progress reporting
- -n, --no-checkout don't create a checkout
- --bare create a bare repository
- --mirror create a mirror repository (implies bare)
- -l, --local to clone from a local repository
- --no-hardlinks don't use local hardlinks, always copy
- -s, --shared setup as shared repository
- --recursive initialize submodules in the clone
- --recurse-submodules initialize submodules in the clone
- --template <template-directory>
- directory from which templates will be used
- --reference <repo> reference repository
- -o, --origin <name> use <name> instead of 'origin' to track upstream
- -b, --branch <branch>
- checkout <branch> instead of the remote's HEAD
- -u, --upload-pack <path>
- path to git-upload-pack on the remote
- --depth <depth> create a shallow clone of that depth
- --separate-git-dir <gitdir>
- separate git dir from working tree
- -c, --config <key=value>
- set config inside the new repository

参数挺多,但常用的就几个:
1. 最简单直接的命令
- git clone xxx.git
2. 如果想clone到指定目录
- git clone xxx.git "指定目录"
3. clone时创建新的分支替代默认Origin HEAD(master)
- git clone -b [new_branch_name] xxx.git
4. clone 远程分支
git clone 命令默认的只会建立master分支,如果你想clone指定的某一远程分支(如:dev)的话,可以如下:
A. 查看所有分支(包括隐藏的) git branch -a 显示所有分支,如:
- * master
- remotes/origin/HEAD -> origin/master
- remotes/origin/dev
- remotes/origin/master
B. 在本地新建同名的("dev")分支,并切换到该分支
- git checkout -t origin/dev 该命令等同于:
- git checkout -b dev origin/dev
原文:
http://blog.csdn.net/techbirds_bao/article/details/9179853
git之clone的更多相关文章
- visual studio2015从git上clone(克隆)项目
本文介绍Visual Studio2015从git上clone项目代码的步骤. 1.打开VS2015,进到起始页,打开"团队资源管理器",如下图: 2.点击"克隆&quo ...
- 使用git svn clone迁移svn仓库
使用git svn clone迁移svn仓库 clone命令可以指定很多参数,主要用到这些,你也可以使用git svn help查看完整的参数列表. git svn clone https://172 ...
- svn版本库包含多个项目 ; git svn clone; 某一个子项目,有多个分支;
情况描述: 公司的svn版本库,包含了多个项目,每个项目对应于1个文件夹 假设版本库名字为Main,其下的项目用 A项目,对应文件夹A B项目,对应文件夹B 通过git svn clone获取了svn ...
- Git 如何 clone 非 master 分支的代码
问题描述 我们每次使用命令 git clone git@gitlab.xxx.com:xxxxx.git 默认 clone 的是这个仓库的 master 分支.如果最新的代码不在 master 分支上 ...
- Git SVN Clone 旧项目迁移到 Git 上
Git SVN Clone 旧项目迁移到 Git 上 很久使用的是 SVN,但由于项目重启,想改为 Git. 之前的 SVN 仓库是本地,所以在 git svn clone 一直不成功. 正确的方式: ...
- 使用git svn clone迁移svn仓库(保留提交记录)
使用git svn clone迁移svn仓库 clone命令可以指定很多参数,主要用到这些,你也可以使用git svn help查看完整的参数列表. git svn clone https://172 ...
- git的clone和github的fork
git的clone是从github上下载下来,clone到项目里面,fork是在本地修改后再提交到github上,在github上用request来进行提交,经作者确认后可以合同到mast分支上
- Ubuntu环境下使用npm编译从git上clone下来的前端(Javascript)项目
一.更新Ubuntu软件源 打开终端依次输入: $ sudo apt-get update $ sudo apt-get install -y python-software-properties s ...
- 【CMake】CMake ERROR:could not find git for clone of
在使用 CMake 构建VS2015项目时遇到一个错误提示:could not find git for clone of. 因为项目需要从GitHub导入运行库,但构建项目时提示未能找到这个库,而g ...
随机推荐
- 微信小程序相关资料整理
微信小程序官方介绍https://mp.weixin.qq.com/debug/wxadoc/introduction/index.html?t=201818 微信小程序开发资源https://jue ...
- python:字典的方法
1.查找字典中的key对应的值和key是否存在(get,has_key)dict.get(key, default = None) :返回字典中key对应的值,若key不存在字典中,则返回defaul ...
- QT线程
一.QObject子类 说明:以串口线程传输文件为例子,使用的是MoveTothread函数. void QObject::moveToThread(QThread *targetThread)可以将 ...
- MATLAB更换字体后 中文显示乱码问题
MATLAB的脚本代码默认宋体显示,对于大多数720P的显示器来说,无论是中文还是英文,显示效果都非常差.Windows环境下,Consolas是一种比较理想的英文代码字体. Consolas 字体是 ...
- EF Code-First 学习之旅 继承策略
Code First中有三种不同的方法表示继承层次关系 1.Table per Hierarchy (TPH): 这种方法建议用一个表来表示整个类的继承层次关系,表中包含一个识别列来区分继承类,在En ...
- 错误 1 类型“System.Web.Mvc.ModelClientValidationRule”同时存在于“c:\Progra型“System.Web.Mvc.ModelClientValidationRule”同时存在
解决方案: step1:首先关闭你应用程序方案,在你保存项目的文件夹下找到ProjectName.csproj ProjectName是你实际的应用程序名称. step2:用文字编辑器打开你找到它找 ...
- DL四(预处理:主成分分析与白化 Preprocessing PCA and Whitening )
预处理:主成分分析与白化 Preprocessing:PCA and Whitening 一主成分分析 PCA 1.1 基本术语 主成分分析 Principal Components Analysis ...
- Spring boot 更改端口的几种方式
web服务的默认端口是8080,但有时候我们需要更改成其他端口,这里有几种端口修改方式: 在application.properties文件添加配置(最简单) server.port= 在applic ...
- list添加map问题
结论: list添加添加的是map的地址 List<Map<String, Object>> list = new ArrayList<>(); Map<St ...
- nova rebuild
nova rebuild¶ usage: nova rebuild [--rebuild-password <rebuild-password>] [--poll] [--minimal] ...