git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Pushing a new branch to a remote and tracking it
@ 2010-07-27 22:12 Bradley Wagner
  2010-07-27 22:35 ` Andreas Schwab
  0 siblings, 1 reply; 3+ messages in thread
From: Bradley Wagner @ 2010-07-27 22:12 UTC (permalink / raw)
  To: git

Is there a more elegant way to: 1) create a branch, 2) push it to a
remote and 3) continue to track it.

I noticed that:

git branch <branchname> HEAD
git checkout <branchname>
git push origin <branchname>

does not link the local branch to the remote.

I've seen other people do:

git push origin origin:refs/heads/<branchname>
git fetch origin
git branch -r (verify that the branch is there)
git checkout <branchname> -b origin/<branchname>

but it seems kind of the reverse of what I would expect to do. I know
I could also do the first thing and then delete/re-checkout the branch
with tracking.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-07-28  1:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-27 22:12 Pushing a new branch to a remote and tracking it Bradley Wagner
2010-07-27 22:35 ` Andreas Schwab
2010-07-28  1:20   ` Bradley Wagner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).