]>
Commit | Line | Data |
---|---|---|
215a7ad1 JH |
1 | git-push(1) |
2 | =========== | |
7fc9d69f JH |
3 | |
4 | NAME | |
5 | ---- | |
7bd7f280 | 6 | git-push - Update remote refs along with associated objects |
7fc9d69f JH |
7 | |
8 | ||
9 | SYNOPSIS | |
10 | -------- | |
dc36f265 | 11 | 'git-push' [--all] [--tags] [--exec=<receive-pack>] [--repo=all] [-f | --force] [-v] [<repository> <refspec>...] |
7fc9d69f JH |
12 | |
13 | DESCRIPTION | |
14 | ----------- | |
ab9b3138 JH |
15 | |
16 | Updates remote refs using local refs, while sending objects | |
17 | necessary to complete the given refs. | |
7fc9d69f | 18 | |
cc55aaec | 19 | You can make interesting things happen to a repository |
eb0362a4 JH |
20 | every time you push into it, by setting up 'hooks' there. See |
21 | documentation for gitlink:git-receive-pack[1]. | |
22 | ||
7fc9d69f JH |
23 | |
24 | OPTIONS | |
25 | ------- | |
3598a308 | 26 | <repository>:: |
85a97d4e BF |
27 | The "remote" repository that is destination of a push |
28 | operation. See the section <<URLS,GIT URLS>> below. | |
3598a308 BF |
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 | + | |
aa064743 CW |
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 | + | |
25fb6290 | 52 | `tag <tag>` means the same as `refs/tags/<tag>:refs/tags/<tag>`. |
3598a308 | 53 | + |
25fb6290 JH |
54 | A parameter <ref> without a colon is equivalent to |
55 | <ref>`:`<ref>, hence updates <ref> in the destination from <ref> | |
56 | in the source. | |
57 | + | |
58 | Pushing an empty <src> allows you to delete the <dst> ref from | |
59 | the remote repository. | |
7fc9d69f | 60 | |
d6a73596 | 61 | \--all:: |
cc55aaec BF |
62 | Instead of naming each ref to push, specifies that all |
63 | refs be pushed. | |
d6a73596 | 64 | |
42301e34 JH |
65 | \--tags:: |
66 | All refs under `$GIT_DIR/refs/tags` are pushed, in | |
67 | addition to refspecs explicitly listed on the command | |
68 | line. | |
69 | ||
5214f770 UKK |
70 | \--exec:: |
71 | Path to the 'git-receive-pack' program on the remote | |
72 | end. Sometimes useful when pushing to a remote | |
73 | repository over ssh, and you do not have the program in | |
74 | a directory on the default $PATH. | |
75 | ||
d6a73596 | 76 | -f, \--force:: |
f0fff36e | 77 | Usually, the command refuses to update a remote ref that is |
addf88e4 | 78 | not a descendant of the local ref used to overwrite it. |
f0fff36e BF |
79 | This flag disables the check. This can cause the |
80 | remote repository to lose commits; use it with care. | |
7fc9d69f | 81 | |
dc36f265 JH |
82 | \--repo=<repo>:: |
83 | When no repository is specified the command defaults to | |
84 | "origin"; this overrides it. | |
85 | ||
86 | \--thin, \--no-thin:: | |
87 | These options are passed to `git-send-pack`. Thin | |
88 | transfer spends extra cycles to minimize the number of | |
89 | objects to be sent and meant to be used on slower connection. | |
90 | ||
91 | -v:: | |
92 | Run verbosely. | |
93 | ||
85a97d4e | 94 | include::urls.txt[] |
eb0362a4 | 95 | |
7fc9d69f JH |
96 | Author |
97 | ------ | |
25fb6290 JH |
98 | Written by Junio C Hamano <junkio@cox.net>, later rewritten in C |
99 | by Linus Torvalds <torvalds@osdl.org> | |
7fc9d69f JH |
100 | |
101 | Documentation | |
102 | -------------- | |
103 | Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>. | |
104 | ||
105 | GIT | |
106 | --- | |
a7154e91 | 107 | Part of the gitlink:git[7] suite |
7fc9d69f | 108 |