blob: d4ae99fa530a50fd354dc54004a7342afd693947 [file] [log] [blame]
Junio C Hamano1a4e8412005-12-27 08:17:231git-push(1)
2===========
3
4NAME
5----
Junio C Hamano01078922006-03-10 00:31:476git-push - Update remote refs along with associated objects
Junio C Hamano1a4e8412005-12-27 08:17:237
8
9SYNOPSIS
10--------
Junio C Hamanod7e63042006-08-02 21:12:2311'git-push' [--all] [--tags] [-f | --force] <repository> <refspec>...
Junio C Hamano1a4e8412005-12-27 08:17:2312
13DESCRIPTION
14-----------
15
16Updates remote refs using local refs, while sending objects
17necessary to complete the given refs.
18
Junio C Hamano40f2f8d2006-02-07 08:04:3919You can make interesting things happen to a repository
Junio C Hamano1a4e8412005-12-27 08:17:2320every time you push into it, by setting up 'hooks' there. See
21documentation for gitlink:git-receive-pack[1].
22
23
24OPTIONS
25-------
Junio C Hamano40f2f8d2006-02-07 08:04:3926<repository>::
27The "remote" repository that is destination of a push
28operation. See the section <<URLS,GIT URLS>> below.
29
30<refspec>::
31The canonical format of a <refspec> parameter is
32`+?<src>:<dst>`; that is, an optional plus `+`, followed
33by the source ref, followed by a colon `:`, followed by
34the destination ref.
35+
36The <src> side can be an
37arbitrary "SHA1 expression" that can be used as an
38argument to `git-cat-file -t`. E.g. `master~4` (push
39four parents before the current master head).
40+
41The local ref that matches <src> is used
42to fast forward the remote ref that matches <dst>. If
43the optional plus `+` is used, the remote ref is updated
44even if it does not result in a fast forward update.
45+
Junio C Hamano7e9f6b72006-02-22 10:44:5546Note: If no explicit refspec is found, (that is neither
47on the command line nor in any Push line of the
48corresponding remotes file---see below), then all the
49refs that exist both on the local side and on the remote
50side are updated.
51+
Junio C Hamano40f2f8d2006-02-07 08:04:3952Some short-cut notations are also supported.
53+
54* `tag <tag>` means the same as `refs/tags/<tag>:refs/tags/<tag>`.
55* A parameter <ref> without a colon is equivalent to
56 <ref>`:`<ref>, hence updates <ref> in the destination from <ref>
57 in the source.
Junio C Hamano1a4e8412005-12-27 08:17:2358
59\--all::
Junio C Hamano40f2f8d2006-02-07 08:04:3960Instead of naming each ref to push, specifies that all
61refs be pushed.
Junio C Hamano1a4e8412005-12-27 08:17:2362
Junio C Hamano02d6fa52006-01-16 08:23:2363\--tags::
64All refs under `$GIT_DIR/refs/tags` are pushed, in
65addition to refspecs explicitly listed on the command
66line.
67
Junio C Hamano1a4e8412005-12-27 08:17:2368-f, \--force::
Junio C Hamano560a1f62006-01-30 04:19:5769Usually, the command refuses to update a remote ref that is
Junio C Hamano51c2ab02006-07-09 20:38:5470not a descendant of the local ref used to overwrite it.
Junio C Hamano560a1f62006-01-30 04:19:5771This flag disables the check. This can cause the
72remote repository to lose commits; use it with care.
Junio C Hamano1a4e8412005-12-27 08:17:2373
Junio C Hamano40f2f8d2006-02-07 08:04:3974include::urls.txt[]
Junio C Hamano1a4e8412005-12-27 08:17:2375
76Author
77------
78Written by Junio C Hamano <junkio@cox.net>
79
80Documentation
81--------------
82Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.
83
84GIT
85---
86Part of the gitlink:git[7] suite
87