Autogenerated man pages for 36de72aa9dc3b7daf8cf2770c840f39bb0d2ae70
[git.git] / man1 / git-clone.1
1 .\"Generated by db2man.xsl. Don't modify this, modify the source.
2 .de Sh \" Subsection
3 .br
4 .if t .Sp
5 .ne 5
6 .PP
7 \fB\\$1\fR
8 .PP
9 ..
10 .de Sp \" Vertical space (when we can't use .PP)
11 .if t .sp .5v
12 .if n .sp
13 ..
14 .de Ip \" List item
15 .br
16 .ie \\n(.$>=3 .ne \\$3
17 .el .ne 3
18 .IP "\\$1" \\$2
19 ..
20 .TH "GIT-CLONE" 1 "" "" ""
21 .SH NAME
22 git-clone \- Clones a repository.
23 .SH "SYNOPSIS"
24
25
26 git\-clone [\-l [\-s]] [\-q] [\-n] [\-o <name>] [\-u <upload\-pack>] <repository> [<directory>]
27
28 .SH "DESCRIPTION"
29
30
31 Clones a repository into a newly created directory\&. All remote branch heads are copied under $GIT_DIR/refs/heads/, except that the remote master is also copied to origin branch\&.
32
33
34 In addition, $GIT_DIR/remotes/origin file is set up to have this line:
35
36 .nf
37 Pull: master:origin
38 .fi
39
40
41 This is to help the typical workflow of working off of the remote master branch\&. Every time git pull without argument is run, the progress on the remote master branch is tracked by copying it into the local origin branch, and merged into the branch you are currently working on\&. Remote branches other than master are also added there to be tracked\&.
42
43 .SH "OPTIONS"
44
45 .TP
46 \-\-local, \-l, 
47 When the repository to clone from is on a local machine, this flag bypasses normal "git aware" transport mechanism and clones the repository by making a copy of HEAD and everything under objects and refs directories\&. The files under \&.git/objects/ directory are hardlinked to save space when possible\&.
48
49 .TP
50 \-\-shared, \-s, 
51 When the repository to clone is on the local machine, instead of using hard links, automatically setup \&.git/objects/info/alternatives to share the objects with the source repository\&. The resulting repository starts out without any object of its own\&.
52
53 .TP
54 \-\-quiet, \-q, 
55 Operate quietly\&. This flag is passed to "rsync" and "git\-clone\-pack" commands when given\&.
56
57 .TP
58 \-n
59 No checkout of HEAD is performed after the clone is complete\&.
60
61 .TP
62 \-o <name>
63 Instead of using the branch name origin to keep track of the upstream repository, use <name> instead\&. Note that the shorthand name stored in remotes/origin is not affected, but the local branch name to pull the remote master branch into is\&.
64
65 .TP
66 \-\-upload\-pack <upload\-pack>, \-u <upload\-pack>, 
67 When given, and the repository to clone from is handled by git\-clone\-pack, \-\-exec=<upload\-pack> is passed to the command to specify non\-default path for the command run on the other end\&.
68
69 .TP
70 <repository>
71 The (possibly remote) repository to clone from\&. It can be any URL git\-fetch supports\&.
72
73 .TP
74 <directory>
75 The name of a new directory to clone into\&. The "humanish" part of the source repository is used if no directory is explicitly given ("repo" for "/path/to/repo\&.git" and "foo" for "host\&.xz:foo/\&.git")\&. Cloning into an existing directory is not allowed\&.
76
77 .SS "Examples"
78
79 .TP
80 Clone from upstream
81
82 .IP
83 $ git clone git://git\&.kernel\&.org/pub/scm/\&.\&.\&./linux\-2\&.6 my2\&.6
84 $ cd my2\&.6
85 $ make
86 .TP
87 Make a local clone that borrows from the current directory, without checking things out
88
89 .IP
90 $ git clone \-l \-s \-n \&. \&.\&./copy
91 $ cd copy
92 $ git show\-branch
93 .SH "AUTHOR"
94
95
96 Written by Linus Torvalds <torvalds@osdl\&.org>
97
98 .SH "DOCUMENTATION"
99
100
101 Documentation by Junio C Hamano and the git\-list <git@vger\&.kernel\&.org>\&.
102
103 .SH "GIT"
104
105
106 Part of the \fBgit\fR(7) suite
107