Documentation / git-clone.txton commit Simplify CFLAGS/DEFINES in Makefile (12aa745)
   1git-clone(1)
   2============
   3
   4NAME
   5----
   6git-clone - Clones a repository.
   7
   8
   9SYNOPSIS
  10--------
  11'git-clone' [-l [-s]] [-q] [-n] [-u <upload-pack>] <repository> <directory>
  12
  13DESCRIPTION
  14-----------
  15Clones a repository into a newly created directory.  All remote
  16branch heads are copied under `$GIT_DIR/refs/heads/`, except
  17that the remote `master` is also copied to `origin` branch.
  18
  19In addition, `$GIT_DIR/remotes/origin` file is set up to have
  20this line:
  21
  22        Pull: master:origin
  23
  24This is to help the typical workflow of working off of the
  25remote `master` branch.  Every time `git pull` without argument
  26is run, the progress on the remote `master` branch is tracked by
  27copying it into the local `origin` branch, and merged into the
  28branch you are currently working on.
  29
  30
  31OPTIONS
  32-------
  33--local::
  34-l::
  35        When the repository to clone from is on a local machine,
  36        this flag bypasses normal "git aware" transport
  37        mechanism and clones the repository by making a copy of
  38        HEAD and everything under objects and refs directories.
  39        The files under .git/objects/ directory are hardlinked
  40        to save space when possible.
  41
  42--shared::
  43-s::
  44        When the repository to clone is on the local machine,
  45        instead of using hard links, automatically setup
  46        .git/objects/info/alternatives to share the objects
  47        with the source repository.  The resulting repository
  48        starts out without any object of its own.
  49
  50--quiet::
  51-q::
  52        Operate quietly.  This flag is passed to "rsync" and
  53        "git-clone-pack" commands when given.
  54
  55-n::
  56        No checkout of HEAD is performed after the clone is complete.
  57
  58--upload-pack <upload-pack>::
  59-u <upload-pack>::
  60        When given, and the repository to clone from is handled
  61        by 'git-clone-pack', '--exec=<upload-pack>' is passed to
  62        the command to specify non-default path for the command
  63        run on the other end.
  64
  65<repository>::
  66        The (possibly remote) repository to clone from.  It can
  67        be any URL git-fetch supports.
  68
  69<directory>::
  70        The name of a new directory to be cloned into.  It is an
  71        error to specify an existing directory.
  72
  73
  74Author
  75------
  76Written by Linus Torvalds <torvalds@osdl.org>
  77
  78Documentation
  79--------------
  80Documentation by Junio C Hamano.
  81
  82
  83GIT
  84---
  85Part of the gitlink:git[7] suite
  86