6 git-clone - Clones a repository.
12 'git-clone' [-l [-s]] [-q] [-n] [-u <upload-pack>]
13 <repository> [<directory>]
17 Clones a repository into a newly created directory. All remote
18 branch heads are copied under `$GIT_DIR/refs/heads/`, except
19 that the remote `master` is also copied to `origin` branch.
21 In addition, `$GIT_DIR/remotes/origin` file is set up to have
26 This is to help the typical workflow of working off of the
27 remote `master` branch. Every time `git pull` without argument
28 is run, the progress on the remote `master` branch is tracked by
29 copying it into the local `origin` branch, and merged into the
30 branch you are currently working on. Remote branches other than
31 `master` are also added there to be tracked.
38 When the repository to clone from is on a local machine,
39 this flag bypasses normal "git aware" transport
40 mechanism and clones the repository by making a copy of
41 HEAD and everything under objects and refs directories.
42 The files under .git/objects/ directory are hardlinked
43 to save space when possible.
47 When the repository to clone is on the local machine,
48 instead of using hard links, automatically setup
49 .git/objects/info/alternatives to share the objects
50 with the source repository. The resulting repository
51 starts out without any object of its own.
55 Operate quietly. This flag is passed to "rsync" and
56 "git-clone-pack" commands when given.
59 No checkout of HEAD is performed after the clone is complete.
61 --upload-pack <upload-pack>::
63 When given, and the repository to clone from is handled
64 by 'git-clone-pack', '--exec=<upload-pack>' is passed to
65 the command to specify non-default path for the command
69 The (possibly remote) repository to clone from. It can
70 be any URL git-fetch supports.
73 The name of a new directory to clone into. The "humanish"
74 part of the source repository is used if no directory is
75 explicitly given ("repo" for "/path/to/repo.git" and "foo"
76 for "host.xz:foo/.git"). Cloning into an existing directory
85 $ git clone git://git.kernel.org/pub/scm/.../linux-2.6 my2.6
91 Make a local clone that borrows from the current directory, without checking things out::
94 $ git clone -l -s -n . ../copy
101 Written by Linus Torvalds <torvalds@osdl.org>
106 Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.
111 Part of the gitlink:git[7] suite