6 git-clone - Clones a repository.
11 'git-clone' [-l [-s]] [-q] [-n] [-o <name>] [-u <upload-pack>] <repository> [<directory>]
15 Clones a repository into a newly created directory. All remote
16 branch heads are copied under `$GIT_DIR/refs/heads/`, except
17 that the remote `master` is also copied to `origin` branch.
19 In addition, `$GIT_DIR/remotes/origin` file is set up to have
24 This is to help the typical workflow of working off of the
25 remote `master` branch. Every time `git pull` without argument
26 is run, the progress on the remote `master` branch is tracked by
27 copying it into the local `origin` branch, and merged into the
28 branch you are currently working on. Remote branches other than
29 `master` are also added there to be tracked.
36 When the repository to clone from is on a local machine,
37 this flag bypasses normal "git aware" transport
38 mechanism and clones the repository by making a copy of
39 HEAD and everything under objects and refs directories.
40 The files under .git/objects/ directory are hardlinked
41 to save space when possible.
45 When the repository to clone is on the local machine,
46 instead of using hard links, automatically setup
47 .git/objects/info/alternatives to share the objects
48 with the source repository. The resulting repository
49 starts out without any object of its own.
53 Operate quietly. This flag is passed to "rsync" and
54 "git-clone-pack" commands when given.
57 No checkout of HEAD is performed after the clone is complete.
60 Instead of using the branch name 'origin' to keep track
61 of the upstream repository, use <name> instead. Note
62 that the shorthand name stored in `remotes/origin` is
63 not affected, but the local branch name to pull the
64 remote `master` branch into is.
66 --upload-pack <upload-pack>::
68 When given, and the repository to clone from is handled
69 by 'git-clone-pack', '--exec=<upload-pack>' is passed to
70 the command to specify non-default path for the command
74 The (possibly remote) repository to clone from. It can
75 be any URL git-fetch supports.
78 The name of a new directory to clone into. The "humanish"
79 part of the source repository is used if no directory is
80 explicitly given ("repo" for "/path/to/repo.git" and "foo"
81 for "host.xz:foo/.git"). Cloning into an existing directory
90 $ git clone git://git.kernel.org/pub/scm/.../linux-2.6 my2.6
96 Make a local clone that borrows from the current directory, without checking things out::
99 $ git clone -l -s -n . ../copy
106 Written by Linus Torvalds <torvalds@osdl.org>
111 Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.
116 Part of the gitlink:git[7] suite