git clone command parameters:
Usage:git clone [Options] [--] <repo> [<dir>]-V,--verbose is more verbose-q,--quiet Be more quiet--progress force progress Reporting-n,--no-checkout don ' t create a checkout--b Is create a bare repository--mirror create a mirror repository (implies bare)-L,--lo Cal to clone from a local repository--no-hardlinks don ' t use local hardlinks, always copy-s,--sh Ared Setup as shared repository--recursive initialize submodules in the clone--recurse-submodul ES initialize submodules in the Clones--template <template-directory> directory from WH Ich templates would 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 <dept H> Create a shallow clone of that depth--separate-git-dir <gitdir> separate GI T dir from working tree-c,--config <key=value> set config inside the new repository
There are many parameters, but there are several common ones:
1. The simplest and most straightforward command
git clone xxx.git
2. If you want to clone to the specified directory
git clone xxx.git "Specify directory"
3. Clone creates a new branch instead of the default Origin HEAD (master)
Git clone-b [new_branch_name] Xxx.git
4. Clone Remote Branch
The git clone command defaults to only the master branch, and if you want to clone a remote branch (for example: Dev), you can do the following:
A. View all branches (including hidden) git branch-a Show all branches, such as:
* Master remotes/origin/head, Origin/master remotes/origin/dev remotes/origin/master
B. Create a new branch with the same name ("Dev") locally and switch to that branch
git checkout-t origin/dev This command is equivalent to: git checkout-b dev Origin/dev
Original:
http://blog.csdn.net/techbirds_bao/article/details/9179853
Clone of Git