git clone命令使用
2018-02-01 17:04
489 查看
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
相关文章推荐
- git clone命令使用
- Git原理命令介绍 以及 eclipse下使用egit和git clone
- Git Clone命令直接使用用户名密码Clone
- Git clone命令使用详解
- 第二章-第二题(练习使用git的add/commit/push/pull/fetch/clone等基本命令)--龙秋娴
- git clone命令使用
- git clone命令使用
- GIT命令 clone remote fetch pull push 的使用
- 无法使用git clone 命令
- Git的初次使用 ; Git常用命令查询 ; Git push ; Git pull 2011-12-16 17:32 在介绍安装和简单使用前,先看一下百度百科中的简介吧: ———————————
- git二分法查找命令的使用
- GIT常用命令 && GIT本地使用 && GIT报错解决 && GIT的忽略文件(ignore files)
- 你所需要知道的一些git 的使用命令:基本技巧
- Git 各常见命令、使用方法、笔记
- git 命令的使用(四)
- 你所需要知道的一些git 的使用命令:分支
- 你所需要知道的一些git 的使用命令:克隆
- git config命令使用第一篇——介绍,基本操作,增删改查
- git config命令使用第一篇——介绍,基本操作,增删改查
- Git 常用命令 和使用方法