The goal is so after doing git clone git@somewhere:something.git
The resulting something/.git/config
will contain
[push]
de
Since it is difficult to enforce policy on the downstream or client side (which is dangerous, as knittl comments), the upcoming Git 2.0 recognizes that fact and will change the default push policy.
(The discussions on this date from early 2012, as illustrated in "git push current branch")
It will go from the current default one:
matching
- push all branches having the same name in both ends.
This is for those who prepare all the branches into a publishable shape and then push them out with a single command.
It is not 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 currently the default, but Git 2.0 will change the default tosimple
.
To the new one, called "simple
":
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.
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. It will become the default in Git 2.0.