[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gits] pushing a branch



"Leigh" == Leigh Stoller <lbstoller at gmail.com> writes:

	Leigh> So if I am on a tracking branch and I want to push it up:
	Leigh>	boss> git push
	Leigh>
	Leigh> pushes the branch but also everything else. So I do:
	Leigh>
	Leigh>	boss> git push central aptui
	Leigh>
	Leigh> and that works. But is there a way to tell git to just push
	Leigh> the branch I am sitting in? If I have to remember different
	Leigh> commands depending on the branch I am in, I am hosed.

I think that the following addition to your ".gitconfig" will do what you want:

	[push]
		default = simple

Other choices you might like are "upstream" and "current".

Longer answer: The default behvaior of "git push" has changed in recent
versions of git.  The old default is what you describe: push all the branches
that have matching names on both ends.  But a lot of people did not like this,
and in Git 2.0, the default will change to "simple".

Depending on how old your git client is, some of the options may not be
available.  "tracking" works in older versions and is a synonym for "upstream".

See <http://git-scm.com/docs/git-config> for more.  Look for the description of
"push.default".

Eric.

-- 
-------------------------------------------------------------------------------
Eric Eide <eeide at cs.utah.edu>  .         University of Utah School of Computing
http://www.cs.utah.edu/~eeide/ . +1 (801) 585-5512 voice, +1 (801) 581-5843 FAX