[Development] gerrit : using branches (was: pointers to use it cleverly/efficiently?)

Welbourne Edward edward.welbourne at theqtcompany.com
Mon Apr 4 17:12:33 CEST 2016


> Forgot - maybe a stupid question, but can you set up a topic branch to
> track a remote branch (and would that make sense)?

$ git checkout -b topic remote/branch

will, by default, set up topic so that, while it's checked out, git pull
fetches remote/branch to merge with it (or rebase it onto) and git push
sends HEAD to remote as an update to branch.  Note, however, that if you
have a local branch tracking remote/branch and use local branch instead
of remote/branch in your checkout, it'll do none of that set-up for you;
you'll need to git branch --set-upstream-to=remote/branch if that's what
you want; and, if you want to pull from remote/branch but push to
something else (e.g. remote/topic), you'll have to juggle with git
config (and I'm not actually sure what the details are).  See the man
page for git branch for details of setting what a branch tracks.

	Eddy.



More information about the Development mailing list