Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1 | git-push(1) |
| 2 | =========== |
| 3 | |
| 4 | NAME |
| 5 | ---- |
Junio C Hamano | 0107892 | 2006-03-10 00:31:47 | [diff] [blame] | 6 | git-push - Update remote refs along with associated objects |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 7 | |
| 8 | |
| 9 | SYNOPSIS |
| 10 | -------- |
Junio C Hamano | d7e6304 | 2006-08-02 21:12:23 | [diff] [blame] | 11 | 'git-push' [--all] [--tags] [-f | --force] <repository> <refspec>... |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 12 | |
| 13 | DESCRIPTION |
| 14 | ----------- |
| 15 | |
| 16 | Updates remote refs using local refs, while sending objects |
| 17 | necessary to complete the given refs. |
| 18 | |
Junio C Hamano | 40f2f8d | 2006-02-07 08:04:39 | [diff] [blame] | 19 | You can make interesting things happen to a repository |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 20 | every time you push into it, by setting up 'hooks' there. See |
| 21 | documentation for gitlink:git-receive-pack[1]. |
| 22 | |
| 23 | |
| 24 | OPTIONS |
| 25 | ------- |
Junio C Hamano | 40f2f8d | 2006-02-07 08:04:39 | [diff] [blame] | 26 | <repository>:: |
| 27 | The "remote" repository that is destination of a push |
| 28 | operation. See the section <<URLS,GIT URLS>> below. |
| 29 | |
| 30 | <refspec>:: |
| 31 | The canonical format of a <refspec> parameter is |
| 32 | `+?<src>:<dst>`; that is, an optional plus `+`, followed |
| 33 | by the source ref, followed by a colon `:`, followed by |
| 34 | the destination ref. |
| 35 | + |
| 36 | The <src> side can be an |
| 37 | arbitrary "SHA1 expression" that can be used as an |
| 38 | argument to `git-cat-file -t`. E.g. `master~4` (push |
| 39 | four parents before the current master head). |
| 40 | + |
| 41 | The local ref that matches <src> is used |
| 42 | to fast forward the remote ref that matches <dst>. If |
| 43 | the optional plus `+` is used, the remote ref is updated |
| 44 | even if it does not result in a fast forward update. |
| 45 | + |
Junio C Hamano | 7e9f6b7 | 2006-02-22 10:44:55 | [diff] [blame] | 46 | Note: If no explicit refspec is found, (that is neither |
| 47 | on the command line nor in any Push line of the |
| 48 | corresponding remotes file---see below), then all the |
| 49 | refs that exist both on the local side and on the remote |
| 50 | side are updated. |
| 51 | + |
Junio C Hamano | 40f2f8d | 2006-02-07 08:04:39 | [diff] [blame] | 52 | Some 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 Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 58 | |
| 59 | \--all:: |
Junio C Hamano | 40f2f8d | 2006-02-07 08:04:39 | [diff] [blame] | 60 | Instead of naming each ref to push, specifies that all |
| 61 | refs be pushed. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 62 | |
Junio C Hamano | 02d6fa5 | 2006-01-16 08:23:23 | [diff] [blame] | 63 | \--tags:: |
| 64 | All refs under `$GIT_DIR/refs/tags` are pushed, in |
| 65 | addition to refspecs explicitly listed on the command |
| 66 | line. |
| 67 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 68 | -f, \--force:: |
Junio C Hamano | 560a1f6 | 2006-01-30 04:19:57 | [diff] [blame] | 69 | Usually, the command refuses to update a remote ref that is |
Junio C Hamano | 51c2ab0 | 2006-07-09 20:38:54 | [diff] [blame] | 70 | not a descendant of the local ref used to overwrite it. |
Junio C Hamano | 560a1f6 | 2006-01-30 04:19:57 | [diff] [blame] | 71 | This flag disables the check. This can cause the |
| 72 | remote repository to lose commits; use it with care. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 73 | |
Junio C Hamano | 40f2f8d | 2006-02-07 08:04:39 | [diff] [blame] | 74 | include::urls.txt[] |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 75 | |
| 76 | Author |
| 77 | ------ |
| 78 | Written by Junio C Hamano <junkio@cox.net> |
| 79 | |
| 80 | Documentation |
| 81 | -------------- |
| 82 | Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>. |
| 83 | |
| 84 | GIT |
| 85 | --- |
| 86 | Part of the gitlink:git[7] suite |
| 87 | |