summaryrefslogtreecommitdiff
path: root/Documentation/git-push.txt
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation/git-push.txt')
-rw-r--r--Documentation/git-push.txt32
1 files changed, 8 insertions, 24 deletions
diff --git a/Documentation/git-push.txt b/Documentation/git-push.txt
index b17283a..3593774 100644
--- a/Documentation/git-push.txt
+++ b/Documentation/git-push.txt
@@ -149,9 +149,8 @@ already exists on the remote side.
Usually, "git push" refuses to update a remote ref that is
not an ancestor of the local ref used to overwrite it.
+
-This option bypasses the check, but instead requires that the
-current value of the ref to be the expected value. "git push"
-fails otherwise.
+This option overrides this restriction if the current value of the
+remote ref is the expected value. "git push" fails otherwise.
+
Imagine that you have to rebase what you have already published.
You will have to bypass the "must fast-forward" rule in order to
@@ -163,15 +162,14 @@ commit, and blindly pushing with `--force` will lose her work.
This option allows you to say that you expect the history you are
updating is what you rebased and want to replace. If the remote ref
still points at the commit you specified, you can be sure that no
-other people did anything to the ref (it is like taking a "lease" on
-the ref without explicitly locking it, and you update the ref while
-making sure that your earlier "lease" is still valid).
+other people did anything to the ref. It is like taking a "lease" on
+the ref without explicitly locking it, and the remote ref is updated
+only if the "lease" is still valid.
+
`--force-with-lease` alone, without specifying the details, will protect
all remote refs that are going to be updated by requiring their
current value to be the same as the remote-tracking branch we have
-for them, unless specified with a `--force-with-lease=<refname>:<expect>`
-option that explicitly states what the expected value is.
+for them.
+
`--force-with-lease=<refname>`, without specifying the expected value, will
protect the named ref (alone), if it is going to be updated, by
@@ -214,22 +212,8 @@ origin +master` to force a push to the `master` branch). See the
`<refspec>...` section above for details.
--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'.
+ This option is equivalent to the <repository> argument. If both
+ are specified, the command-line argument takes precedence.
-u::
--set-upstream::