赞
踩
git clone命令格式:
git clone [--template=<template_directory>]
[-l] [-s] [--no-hardlinks] [-q] [-n] [--bare] [--mirror]
[-o <name>] [-b <name>] [-u <upload-pack>] [--reference <repository>]
[--dissociate] [--separate-git-dir <git dir>]
[--depth <depth>] [--[no-]single-branch]
[--recursive | --recurse-submodules] [--[no-]shallow-submodules]
[--jobs <n>] [--] <repository> [<directory>]其中,常用的参数如下:
-n, 不检出Git库中的active branch
-o new_origin, 使用new_origin,而不使用默认的origin,作为跟踪分支的upstream所在库
-b new_branch, 设置本地的active branch,而非默认的master branch
--single-branch, 只检查一个branch,要么是默认的master,要么是-b new_branch指定的new_branch
--recursive, 在本地初始化Git库中的所有模块
git clone 远程仓库git地址 <本地仓库名> // <>自定义本地仓库名,不写默认远程分支名
git clone -b 远程指定分支 远程仓库git地址 <本地仓库名> // <>自定义本地仓库名,不写默认远程分支名
- git clone http://username:password@remote
-
-
- 例子:
- 地址为:(http://)(git.xxx.com/www.git) ()是书写时要分开的:
-
- git clone http://username:password@git.xxx.com/www.git
- git clone <版本库的网址> <本地目录名>
-
- example:
- git clone http://git@cocoli.git my-master //远程默认为master ,本地设置为了my-master
- git clone -o new_remote_name <url> <new_branch>
- “origin” 并无特殊含义
- 远程仓库名字 “origin” 与分支名字 “master” 一样,在 Git 中并没有任何特别的含义一样。
- 同时 “master” 是当你运行 git init 时默认的起始分支名字,原因仅仅是它的广泛使用,
- “origin” 是当你运行 git clone 时默认的远程仓库名字。 如果你运行 git clone -o
- booyah,那么你默认的远程分支名字将会是 booyah/master。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。