Skip to content

Commit

Permalink
git-push.txt: Describe --repo option in more detail
Browse files Browse the repository at this point in the history
The --repo option was described in a way that the reader would have to
assume that it is the same as the <repository> parameter. But it actually
servers a purpose, which is now written down.

Furthermore, the --mirror option was missing from the synopsis.

Signed-off-by: Johannes Sixt <[email protected]>
Signed-off-by: Shawn O. Pearce <[email protected]>
  • Loading branch information
Johannes Sixt authored and spearce committed Oct 8, 2008
1 parent cced48a commit bf07cc5
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
24 changes: 19 additions & 5 deletions Documentation/git-push.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ git-push - Update remote refs along with associated objects
SYNOPSIS
--------
[verse]
'git push' [--all] [--dry-run] [--tags] [--receive-pack=<git-receive-pack>]
[--repo=all] [-f | --force] [-v | --verbose]
'git push' [--all | --mirror] [--dry-run] [--tags] [--receive-pack=<git-receive-pack>]
[--repo=<repository>] [-f | --force] [-v | --verbose]
[<repository> <refspec>...]

DESCRIPTION
Expand Down Expand Up @@ -101,9 +101,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=<repo>::
When no repository is specified the command defaults to
"origin"; this overrides it.
--repo=<repository>::
This option is only relevant if no <repository> 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::
Expand Down
2 changes: 1 addition & 1 deletion builtin-push.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "parse-options.h"

static const char * const push_usage[] = {
"git push [--all | --mirror] [--dry-run] [--tags] [--receive-pack=<git-receive-pack>] [--repo=all] [-f | --force] [-v] [<repository> <refspec>...]",
"git push [--all | --mirror] [--dry-run] [--tags] [--receive-pack=<git-receive-pack>] [--repo=<repository>] [-f | --force] [-v] [<repository> <refspec>...]",
NULL,
};

Expand Down

0 comments on commit bf07cc5

Please sign in to comment.