Pushing a new branch to a remote and tracking it

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

 



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.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]