X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=Documentation%2Fgit-push.txt;h=7b27dc60bd5a2e58475d39d0c32cdbd6878aa5bd;hb=745bc77604f56d9253958fbcab81c4a8cd3bf170;hp=45c96435fa66ab4b1b57b6a860a2fc264321cfe4;hpb=4a871de89680842ebd43429d5d972375fb765fda;p=git.git diff --git a/Documentation/git-push.txt b/Documentation/git-push.txt index 45c96435f..7b27dc60b 100644 --- a/Documentation/git-push.txt +++ b/Documentation/git-push.txt @@ -9,8 +9,8 @@ git-push - Update remote refs along with associated objects SYNOPSIS -------- [verse] -'git push' [--all] [--dry-run] [--tags] [--receive-pack=] - [--repo=all] [-f | --force] [-v | --verbose] +'git push' [--all | --mirror] [--dry-run] [--tags] [--receive-pack=] + [--repo=] [-f | --force] [-v | --verbose] [ ...] DESCRIPTION @@ -28,7 +28,9 @@ OPTIONS ------- :: The "remote" repository that is destination of a push - operation. See the section <> below. + operation. This parameter can be either a URL + (see the section <> below) or the name + of a remote (see the section <> below). ...:: The canonical format of a parameter is @@ -42,22 +44,21 @@ tip of `master` branch); see linkgit:git-rev-parse[1]) that you want to push. The side represents the destination location. + The local ref that matches is used -to fast forward the remote ref that matches (or, if no was -specified, the same ref that referred to locally). If +to fast forward the remote ref that matches . If the optional leading plus `+` is used, the remote ref is updated even if it does not result in a fast forward update. + `tag ` means the same as `refs/tags/:refs/tags/`. + -A parameter without a colon pushes the from the source -repository to the destination repository under the same name. +A lonely parameter (without a colon and a destination) pushes +the to the same name in the destination repository. + Pushing an empty allows you to delete the ref from the remote repository. + The special refspec `:` (or `+:` to allow non-fast forward updates) -directs git to push "matching" heads: for every head that exists on -the local side, the remote side is updated if a head of the same name +directs git to push "matching" branches: for every branch that exists on +the local side, the remote side is updated if a branch of the same name already exists on the remote side. This is the default operation mode 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). @@ -86,14 +87,12 @@ nor in any Push line of the corresponding remotes file---see below). line. --receive-pack=:: +--exec=:: 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. ---exec=:: - Same as \--receive-pack=. - -f:: --force:: Usually, the command refuses to update a remote ref that is @@ -101,9 +100,23 @@ nor in any Push line of the corresponding remotes file---see below). This flag disables the check. This can cause the remote repository to lose commits; use it with care. ---repo=:: - When no repository is specified the command defaults to - "origin"; this overrides it. +--repo=:: + This option is only relevant if no argument is + passed in the invocation. In this case, 'git-push' derives the + remote name from the current branch: If it tracks a remote + branch, then that remote repository is pushed to. Otherwise, + the name "origin" is used. For this latter case, this option + can be used to override the name "origin". In other words, + the difference between these two commands ++ +-------------------------- +git push public #1 +git push --repo=public #2 +-------------------------- ++ +is that #1 always pushes to "public" whereas #2 pushes to "public" +only if the current branch does not track a remote branch. This is +useful if you write an alias or script around 'git-push'. --thin:: --no-thin::