I have read the git man about push command, but I still don’t understand the EXACT difference between current and upstream to be set in the push.default
I want that our team will just do push, and only changes on the branch that they are currently working on, will be pushed.
As I understand, this branch is the one that marked with * (star) when I do git branch.
Thanks for helping out.
The question is what are you pushing, and to where:
current:upstream:As explained here, Git2.0 will additionally introduce a new default for
push.default:simplesimpleis likeupstream, but the upstream has to have the same name as well or the push will fail.Pushing only one branch (with the mode “
simple“, “current” or “upstream“) avoids the scenario where all matching branches are pushed (mode “matching“, which was the default for a long time), even though some of your branches might not be ready to be pushed.The difference between the two (
currentandupstream) is in the pull (what to pull from the remote to your branch?):pushing “
current” doesn’t mean that your current branchBhasremote/Bhas its upstream branch.Ie:
branch.B.mergeisn’t set, when your are pushing the “current” branch.Ie: when pulling to
B, git won’t know what branch to pull.pushing “
upstream” means that your current branchBhasremote/Bhas its upstream branch.Ie:
branch.B.mergeis set, when your are pushing the “upstream” branch.Ie: when pulling to
B, git knows what branch to pull (as well as which remote repo:branch.B.remote)