summaryrefslogtreecommitdiff
path: root/Documentation/config.txt
diff options
context:
space:
mode:
authorMatthieu Moy <Matthieu.Moy@imag.fr>2012-04-24 09:50:03 +0200
committerJunio C Hamano <gitster@pobox.com>2012-04-24 15:22:16 -0700
commitb55e67752242b449a4577c05341fd6b2fea4d310 (patch)
treeeae985cc0bdc12a2da280403be2da74242e3f546 /Documentation/config.txt
parent321e75c5dc6d6abc76e2349000e93c809ddfcdab (diff)
downloadgit-b55e67752242b449a4577c05341fd6b2fea4d310.tar.gz
push: introduce new push.default mode "simple"
When calling "git push" without argument, we want to allow Git to do something simple to explain and safe. push.default=matching is unsafe when used to push to shared repositories, and hard to explain to beginners in some contexts. It is debatable whether 'upstream' or 'current' is the safest or the easiest to explain, so introduce a new mode called 'simple' that is the intersection of them: push to the upstream branch, but only if it has the same name remotely. If not, give an error that suggests the right command to push explicitely to 'upstream' or 'current'. A question is whether to allow pushing when no upstream is configured. An argument in favor of allowing the push is that it makes the new mode work in more cases. On the other hand, refusing to push when no upstream is configured encourages the user to set the upstream, which will be beneficial on the next pull. Lacking better argument, we chose to deny the push, because it will be easier to change in the future if someone shows us wrong. Original-patch-by: Jeff King <peff@peff.net> Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/config.txt')
-rw-r--r--Documentation/config.txt5
1 files changed, 4 insertions, 1 deletions
diff --git a/Documentation/config.txt b/Documentation/config.txt
index 9617c53951..7f5ad1ce06 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -1686,13 +1686,16 @@ push.default::
appropriate for pushing into a repository shared by multiple users,
since locally stalled branches will attempt a non-fast forward push
if other users updated the branch. This is the default.
+* `simple` - like `upstream`, but refuses to push if the upstream
+ branch's name is different from the local one. This is the safest
+ option and is well-suited for beginners.
* `upstream` - push the current branch to its upstream branch.
With this, `git push` will update the same remote ref as the one which
is merged by `git pull`, making `push` and `pull` symmetrical.
See "branch.<name>.merge" for how to configure the upstream branch.
* `current` - push the current branch to a branch of the same name.
+
- The `current` and `upstream` modes are for those who want to
+ The `simple`, `current` and `upstream` modes are for those who want to
push out a single branch after finishing work, even when the other
branches are not yet ready to be pushed out. If you are working with
other people to push into the same shared repository, you would want