summaryrefslogtreecommitdiff
path: root/Documentation/git-push.txt
diff options
context:
space:
mode:
authorMatthieu Moy <Matthieu.Moy@imag.fr>2013-06-17 19:52:41 +0200
committerJunio C Hamano <gitster@pobox.com>2013-06-18 07:35:48 -0700
commit70495b556f5685afe0e41988e42d48b2331d77a0 (patch)
treef298d319d39c85c5b93913a25513106c7dad53dd /Documentation/git-push.txt
parent04a74b6cfa5ef4870263f84ac94a488d9f2ef14a (diff)
downloadgit-70495b556f5685afe0e41988e42d48b2331d77a0.tar.gz
Documentation/git-push.txt: explain better cases where --force is dangerous
The behavior of "git push --force" is rather clear when it updates only one remote ref, but running it when pushing several branches can really be dangerous. Warn the users a bit more and give them the alternative to push only one branch. Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/git-push.txt')
-rw-r--r--Documentation/git-push.txt9
1 files changed, 9 insertions, 0 deletions
diff --git a/Documentation/git-push.txt b/Documentation/git-push.txt
index 8b637d339f..28a17c34ff 100644
--- a/Documentation/git-push.txt
+++ b/Documentation/git-push.txt
@@ -124,6 +124,15 @@ no `push.default` configuration variable is set.
not an ancestor of the local ref used to overwrite it.
This flag disables the check. This can cause the
remote repository to lose commits; use it with care.
+ Note that `--force` applies to all the refs that are pushed,
+ hence using it with `push.default` set to `matching` or with
+ multiple push destinations configured with `remote.*.push`
+ may overwrite refs other than the current branch (including
+ local refs that are strictly behind their remote counterpart).
+ To force a push to only one branch, use a `+` in front of the
+ refspec to push (e.g `git push 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