Autogenerated man pages for v1.2.4-gf61c2
[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 Note: If no explicit refspec is found, (that is neither on the command line nor in any Push line of the corresponding remotes file\-\-\-see below), then all the refs that exist both on the local side and on the remote side are updated\&.
51
52 Some short\-cut notations are also supported\&.
53
54 .RS
55 .TP 3
56 \(bu
57  tag <tag> means the same as refs/tags/<tag>:refs/tags/<tag>\&.
58 .TP
59 \(bu
60 A parameter <ref> without a colon is equivalent to <ref>:<ref>, hence updates <ref> in the destination from <ref> in the source\&.
61 .LP
62 .RE
63 .IP
64
65 .TP
66 \-\-all
67 Instead of naming each ref to push, specifies that all refs be pushed\&.
68
69 .TP
70 \-\-tags
71 All refs under $GIT_DIR/refs/tags are pushed, in addition to refspecs explicitly listed on the command line\&.
72
73 .TP
74 \-f, \-\-force
75 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\&.
76
77 .SH "GIT URLS"
78
79
80 One of the following notations can be used to name the remote repository:
81
82 .IP
83
84 .TP 3
85 \(bu
86 rsync://host\&.xz/path/to/repo\&.git/
87 .TP
88 \(bu
89 http://host\&.xz/path/to/repo\&.git/
90 .TP
91 \(bu
92 https://host\&.xz/path/to/repo\&.git/
93 .TP
94 \(bu
95 git://host\&.xz/path/to/repo\&.git/
96 .TP
97 \(bu
98 git://host\&.xz/~user/path/to/repo\&.git/
99 .TP
100 \(bu
101 ssh://host\&.xz/path/to/repo\&.git/
102 .TP
103 \(bu
104 ssh://host\&.xz/~user/path/to/repo\&.git/
105 .TP
106 \(bu
107 ssh://host\&.xz/~/path/to/repo\&.git
108 .LP
109
110
111 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:
112
113 .IP
114
115 .TP 3
116 \(bu
117 host\&.xz:/path/to/repo\&.git/
118 .TP
119 \(bu
120 host\&.xz:~user/path/to/repo\&.git/
121 .TP
122 \(bu
123 host\&.xz:path/to/repo\&.git
124 .LP
125
126
127 To sync with a local directory, use:
128
129 .IP
130
131 .TP 3
132 \(bu
133 /path/to/repo\&.git/
134 .LP
135
136 .SH "REMOTES"
137
138
139 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:
140
141 .nf
142 URL: one of the above URL format
143 Push: <refspec>
144 Pull: <refspec>
145 .fi
146
147
148 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\&.
149
150
151 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\&.
152
153 .nf
154 URL: <url>
155 Pull: refs/heads/master:<remote>
156 .fi
157
158
159 while having <url>#<head> is equivalent to
160
161 .nf
162 URL: <url>
163 Pull: refs/heads/<head>:<remote>
164 .fi
165
166 .SH "AUTHOR"
167
168
169 Written by Junio C Hamano <junkio@cox\&.net>
170
171 .SH "DOCUMENTATION"
172
173
174 Documentation by Junio C Hamano and the git\-list <git@vger\&.kernel\&.org>\&.
175
176 .SH "GIT"
177
178
179 Part of the \fBgit\fR(7) suite
180