From: Junio C Hamano Date: Thu, 12 Jan 2006 19:00:18 GMT Subject: Re: [RFD] what should "git push remote.host:path" do? Message-ID: <7v64opp8zh.fsf@assigned-by-dhcp.cox.net> In-Reply-To: "Sean" writes: > What about assuming a refspec of "current-branch:current-branch" ? > That is, if the branch name that is currently checked out locally > also exists upstream, push into it (only if fast forward). > > This should allow multiple branches to be updated locally, and pushed > upstream selectively. Requiring at least one refspec to be given to the command has the same property. Ways to give refspec to the command are: (1) give one or more from the command line (2) give --all from the command line (3) give none from the command line, but in this case you need at least one "Push:" the "remotes" file you use. So it really boils down to "is pushing the current branch a better default"? Even if a project uses CVS style shared repository setup, individual developers would want to use topic branches to prepare things that they eventually push to the shared common, and I suspect that it would lead to more mistakes if we default the push to push the current branch. "Push: master" in the remotes/ file to publish your results to the shared repository would be safer; "git push" when you are still in your topic branch and have not merged things up into your master branch for publication would be no-op, as opposed to pushing the topic branch, probably resulting in the topic branch in the shared repository, even though the topic was meant to be internal to his repository.