The clone of Git

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.