Hi Michael,
On Thursday, April 27, 2017 at 1:42:18 AM UTC+2, Michael Gersten wrote:
>
> Thank you very much.
>
No problem, glad if it helped :)
When I said
> > 843 git fetch origin refs/pull/12121/head
> I was under the impression that explicitly fetching a specific branch also
> set up a tracking branch for it.
>
> I was not aware that I had to say --track
>
In some general use, you don`t even have to say `--track` nowadays, if you
try to checkout a branch that does not exist, but Git finds a remote branch
of the same name, it will be smart and create a new local branch with that
name for you, setting it to track the remote branch automatically.
For example, in a case like this:
$ git branch --all
* master
remotes/gkoelln/Dish
remotes/origin/master
... you can just do (note that local branch "Dish" doesn`t even exist yet):
$ git checkout Dish
... and you`ll get your local remote tracking branch automatically:
Switched to a new branch 'Dish'
Branch Dish set up to track remote branch Dish from gkoelln.
However, in your specific case with "pull request branches" this doesn`t
seem to work as automatically - maybe because of the "special nature" of
those pull request "branches" (residing inside "refs/pull/", instead of
"refs/heads/", on the remote side)...? Not really sure. Yet, `--track` gets
the job done ;)
Regards,
Buga
--
You received this message because you are subscribed to the Google Groups "Git
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.