140f97363a41bd3283ff02f6f555ebfcab08ad28
[git.git] / man1 / git-push.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-PUSH" 1 "" "" ""
21 .SH NAME
22 git-push \- Update remote refs along with associated objects.
23 .SH "SYNOPSIS"
24
25
26 \fIgit\-push\fR [\-\-all] [\-\-tags] [\-\-force] <repository> <refspec>...
27
28 .SH "DESCRIPTION"
29
30
31 Updates remote refs using local refs, while sending objects necessary to complete the given refs\&.
32
33
34 You can make interesting things happen to a repository every time you push into it, by setting up \fIhooks\fR there\&. See documentation for \fBgit\-receive\-pack\fR(1)\&.
35
36 .SH "OPTIONS"
37
38 .TP
39 <repository>
40 The "remote" repository that is destination of a push operation\&. See the section GIT URLS below\&.
41
42 .TP
43 <refspec>
44 The canonical format of a <refspec> parameter is +?<src>:<dst>; that is, an optional plus +, followed by the source ref, followed by a colon :, followed by the destination ref\&.
45
46 The <src> side can be an arbitrary "SHA1 expression" that can be used as an argument to git\-cat\-file \-t\&. E\&.g\&. master~4 (push four parents before the current master head)\&.
47
48 The local ref that matches <src> is used to fast forward the remote ref that matches <dst>\&. If the optional plus + is used, the remote ref is updated even if it does not result in a fast forward update\&.
49
50 Some short\-cut notations are also supported\&.
51
52 .RS
53 .TP 3
54 \(bu
55  tag <tag> means the same as refs/tags/<tag>:refs/tags/<tag>\&.
56 .TP
57 \(bu
58 A parameter <ref> without a colon is equivalent to <ref>:<ref>, hence updates <ref> in the destination from <ref> in the source\&.
59 .LP
60 .RE
61 .IP
62
63 .TP
64 \-\-all
65 Instead of naming each ref to push, specifies that all refs be pushed\&.
66
67 .TP
68 \-\-tags
69 All refs under $GIT_DIR/refs/tags are pushed, in addition to refspecs explicitly listed on the command line\&.
70
71 .TP
72 \-f, \-\-force
73 Usually, the command refuses to update a remote ref that is not a descendent of the local ref used to overwrite it\&. This flag disables the check\&. This can cause the remote repository to lose commits; use it with care\&.
74
75 .SH "GIT URLS"
76
77
78 One of the following notations can be used to name the remote repository:
79
80 .IP
81
82 .TP 3
83 \(bu
84 rsync://host\&.xz/path/to/repo\&.git/
85 .TP
86 \(bu
87 http://host\&.xz/path/to/repo\&.git/
88 .TP
89 \(bu
90 https://host\&.xz/path/to/repo\&.git/
91 .TP
92 \(bu
93 git://host\&.xz/path/to/repo\&.git/
94 .TP
95 \(bu
96 git://host\&.xz/~user/path/to/repo\&.git/
97 .TP
98 \(bu
99 ssh://host\&.xz/path/to/repo\&.git/
100 .TP
101 \(bu
102 ssh://host\&.xz/~user/path/to/repo\&.git/
103 .TP
104 \(bu
105 ssh://host\&.xz/~/path/to/repo\&.git
106 .LP
107
108
109 SSH Is the default transport protocol and also supports an scp\-like syntax\&. Both syntaxes support username expansion, as does the native git protocol\&. The following three are identical to the last three above, respectively:
110
111 .IP
112
113 .TP 3
114 \(bu
115 host\&.xz:/path/to/repo\&.git/
116 .TP
117 \(bu
118 host\&.xz:~user/path/to/repo\&.git/
119 .TP
120 \(bu
121 host\&.xz:path/to/repo\&.git
122 .LP
123
124
125 To sync with a local directory, use:
126
127 .IP
128
129 .TP 3
130 \(bu
131 /path/to/repo\&.git/
132 .LP
133
134 .SH "REMOTES"
135
136
137 In addition to the above, as a short\-hand, the name of a file in $GIT_DIR/remotes directory can be given; the named file should be in the following format:
138
139 .nf
140 URL: one of the above URL format
141 Push: <refspec>
142 Pull: <refspec>
143 .fi
144
145
146 Then such a short\-hand is specified in place of <repository> without <refspec> parameters on the command line, <refspec> specified on Push: lines or Pull: lines are used for git\-push and git\-fetch/git\-pull, respectively\&. Multiple Push: and and Pull: lines may be specified for additional branch mappings\&.
147
148
149 The name of a file in $GIT_DIR/branches directory can be specified as an older notation short\-hand; the named file should contain a single line, a URL in one of the above formats, optionally followed by a hash # and the name of remote head (URL fragment notation)\&. $GIT_DIR/branches/<remote> file that stores a <url> without the fragment is equivalent to have this in the corresponding file in the $GIT_DIR/remotes/ directory\&.
150
151 .nf
152 URL: <url>
153 Pull: refs/heads/master:<remote>
154 .fi
155
156
157 while having <url>#<head> is equivalent to
158
159 .nf
160 URL: <url>
161 Pull: refs/heads/<head>:<remote>
162 .fi
163
164 .SH "AUTHOR"
165
166
167 Written by Junio C Hamano <junkio@cox\&.net>
168
169 .SH "DOCUMENTATION"
170
171
172 Documentation by Junio C Hamano and the git\-list <git@vger\&.kernel\&.org>\&.
173
174 .SH "GIT"
175
176
177 Part of the \fBgit\fR(7) suite
178