2005-09-08 08:26:23 +08:00
|
|
|
git-push(1)
|
|
|
|
===========
|
2005-08-23 16:49:47 +08:00
|
|
|
|
|
|
|
NAME
|
|
|
|
----
|
2006-03-10 00:24:50 +08:00
|
|
|
git-push - Update remote refs along with associated objects
|
2005-08-23 16:49:47 +08:00
|
|
|
|
|
|
|
|
|
|
|
SYNOPSIS
|
|
|
|
--------
|
2007-05-18 21:39:34 +08:00
|
|
|
[verse]
|
2007-10-12 03:32:27 +08:00
|
|
|
'git-push' [--all] [--dry-run] [--tags] [--receive-pack=<git-receive-pack>]
|
2007-11-11 22:01:43 +08:00
|
|
|
[--repo=all] [-f | --force] [-v | --verbose] [<repository> <refspec>...]
|
2005-08-23 16:49:47 +08:00
|
|
|
|
|
|
|
DESCRIPTION
|
|
|
|
-----------
|
2005-08-25 07:23:08 +08:00
|
|
|
|
|
|
|
Updates remote refs using local refs, while sending objects
|
|
|
|
necessary to complete the given refs.
|
2005-08-23 16:49:47 +08:00
|
|
|
|
2006-02-06 08:42:27 +08:00
|
|
|
You can make interesting things happen to a repository
|
2005-12-05 16:32:01 +08:00
|
|
|
every time you push into it, by setting up 'hooks' there. See
|
2007-12-29 14:20:38 +08:00
|
|
|
documentation for linkgit:git-receive-pack[1].
|
2005-12-05 16:32:01 +08:00
|
|
|
|
2005-08-23 16:49:47 +08:00
|
|
|
|
|
|
|
OPTIONS
|
|
|
|
-------
|
2006-02-06 06:43:47 +08:00
|
|
|
<repository>::
|
2006-02-06 07:29:49 +08:00
|
|
|
The "remote" repository that is destination of a push
|
|
|
|
operation. See the section <<URLS,GIT URLS>> below.
|
2006-02-06 06:43:47 +08:00
|
|
|
|
|
|
|
<refspec>::
|
|
|
|
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.
|
|
|
|
+
|
|
|
|
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).
|
|
|
|
+
|
|
|
|
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.
|
|
|
|
+
|
2006-02-22 12:28:50 +08:00
|
|
|
Note: If no explicit refspec is found, (that is neither
|
|
|
|
on the command line nor in any Push line of the
|
2008-02-20 00:25:22 +08:00
|
|
|
corresponding remotes file---see below), then "matching" heads are
|
|
|
|
pushed: for every head that exists on the local side, the remote side is
|
|
|
|
updated if a head of the same name already exists on the remote side.
|
2006-02-22 12:28:50 +08:00
|
|
|
+
|
2006-12-13 16:59:58 +08:00
|
|
|
`tag <tag>` means the same as `refs/tags/<tag>:refs/tags/<tag>`.
|
2006-02-06 06:43:47 +08:00
|
|
|
+
|
2007-06-10 02:01:23 +08:00
|
|
|
A parameter <ref> without a colon pushes the <ref> from the source
|
|
|
|
repository to the destination repository under the same name.
|
2006-12-13 16:59:58 +08:00
|
|
|
+
|
|
|
|
Pushing an empty <src> allows you to delete the <dst> ref from
|
|
|
|
the remote repository.
|
2005-08-23 16:49:47 +08:00
|
|
|
|
2005-10-20 12:25:39 +08:00
|
|
|
\--all::
|
2006-02-06 08:42:27 +08:00
|
|
|
Instead of naming each ref to push, specifies that all
|
2007-09-18 16:15:34 +08:00
|
|
|
refs under `$GIT_DIR/refs/heads/` be pushed.
|
2005-10-20 12:25:39 +08:00
|
|
|
|
2007-11-10 07:32:57 +08:00
|
|
|
\--mirror::
|
|
|
|
Instead of naming each ref to push, specifies that all
|
|
|
|
refs under `$GIT_DIR/refs/heads/` and `$GIT_DIR/refs/tags/`
|
|
|
|
be mirrored to the remote repository. Newly created local
|
|
|
|
refs will be pushed to the remote end, locally updated refs
|
|
|
|
will be force updated on the remote end, and deleted refs
|
|
|
|
will be removed from the remote end.
|
|
|
|
|
2007-10-12 03:32:27 +08:00
|
|
|
\--dry-run::
|
|
|
|
Do everything except actually send the updates.
|
|
|
|
|
2006-01-16 15:27:34 +08:00
|
|
|
\--tags::
|
|
|
|
All refs under `$GIT_DIR/refs/tags` are pushed, in
|
|
|
|
addition to refspecs explicitly listed on the command
|
|
|
|
line.
|
|
|
|
|
2007-01-19 20:49:27 +08:00
|
|
|
\--receive-pack=<git-receive-pack>::
|
2007-01-16 23:02:02 +08:00
|
|
|
Path to the 'git-receive-pack' program on the remote
|
|
|
|
end. Sometimes useful when pushing to a remote
|
|
|
|
repository over ssh, and you do not have the program in
|
|
|
|
a directory on the default $PATH.
|
|
|
|
|
2007-01-19 20:49:27 +08:00
|
|
|
\--exec=<git-receive-pack>::
|
|
|
|
Same as \--receive-pack=<git-receive-pack>.
|
|
|
|
|
2005-10-20 12:25:39 +08:00
|
|
|
-f, \--force::
|
2006-01-30 09:40:50 +08:00
|
|
|
Usually, the command refuses to update a remote ref that is
|
2007-08-05 13:22:15 +08:00
|
|
|
not an ancestor of the local ref used to overwrite it.
|
2006-01-30 09:40:50 +08:00
|
|
|
This flag disables the check. This can cause the
|
|
|
|
remote repository to lose commits; use it with care.
|
2005-08-23 16:49:47 +08:00
|
|
|
|
2007-01-17 03:46:03 +08:00
|
|
|
\--repo=<repo>::
|
|
|
|
When no repository is specified the command defaults to
|
|
|
|
"origin"; this overrides it.
|
|
|
|
|
|
|
|
\--thin, \--no-thin::
|
|
|
|
These options are passed to `git-send-pack`. Thin
|
|
|
|
transfer spends extra cycles to minimize the number of
|
|
|
|
objects to be sent and meant to be used on slower connection.
|
|
|
|
|
2007-11-11 22:01:43 +08:00
|
|
|
-v, \--verbose::
|
2007-01-17 03:46:03 +08:00
|
|
|
Run verbosely.
|
|
|
|
|
2007-07-05 06:21:36 +08:00
|
|
|
include::urls-remotes.txt[]
|
2005-12-05 16:32:01 +08:00
|
|
|
|
2007-06-10 02:01:23 +08:00
|
|
|
|
|
|
|
Examples
|
|
|
|
--------
|
|
|
|
|
|
|
|
git push origin master::
|
|
|
|
Find a ref that matches `master` in the source repository
|
|
|
|
(most likely, it would find `refs/heads/master`), and update
|
|
|
|
the same ref (e.g. `refs/heads/master`) in `origin` repository
|
|
|
|
with it.
|
|
|
|
|
|
|
|
git push origin :experimental::
|
|
|
|
Find a ref that matches `experimental` in the `origin` repository
|
|
|
|
(e.g. `refs/heads/experimental`), and delete it.
|
|
|
|
|
|
|
|
git push origin master:satellite/master::
|
|
|
|
Find a ref that matches `master` in the source repository
|
|
|
|
(most likely, it would find `refs/heads/master`), and update
|
|
|
|
the ref that matches `satellite/master` (most likely, it would
|
|
|
|
be `refs/remotes/satellite/master`) in `origin` repository with it.
|
|
|
|
|
2007-09-06 12:44:08 +08:00
|
|
|
git push origin master:refs/heads/experimental::
|
|
|
|
Create the branch `experimental` in the `origin` repository
|
|
|
|
by copying the current `master` branch. This form is usually
|
|
|
|
needed to create a new branch in the remote repository as
|
|
|
|
there is no `experimental` branch to match.
|
|
|
|
|
2005-08-23 16:49:47 +08:00
|
|
|
Author
|
|
|
|
------
|
2006-12-13 16:59:58 +08:00
|
|
|
Written by Junio C Hamano <junkio@cox.net>, later rewritten in C
|
|
|
|
by Linus Torvalds <torvalds@osdl.org>
|
2005-08-23 16:49:47 +08:00
|
|
|
|
|
|
|
Documentation
|
|
|
|
--------------
|
|
|
|
Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.
|
|
|
|
|
|
|
|
GIT
|
|
|
|
---
|
2007-12-29 14:20:38 +08:00
|
|
|
Part of the linkgit:git[7] suite
|