git config that gets cloned
The goal is so after doing
git clone git@somewhere:something.git
something/.git/config will contain
[push] default = tracking
without requiring the cloner to do
cd something; git config push.default tracking so he/she won’t accidentally push all branches when pushing without argument (No, nobody reads the README).
One Solution collect form web for “git config that gets cloned”
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 to
To the new one, called “
upstream– push the current branch to its upstream branch.
git pushwill 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.