On Wed, 18 Jan 2017 00:55:55 -0800 (PST) Ralf Tobel <[email protected]> wrote:
> After cloning the bundle I just want to be able to checkout a branch > which is shown in list-heads. > > E.g. I see the following line in list-heads: > f63be4c756bf7a6a4cc1db2e08a587a4d3f796c5 > refs/remotes/origin/Version-1.3 > > When I then try to checkout this branch in the clone of the bundle I > get: error: pathspec 'Version-1.3' did not match any file(s) known to > git. I feel like we're going in circles. After cloning or after `git init` + `git fetch -u `refs/*:refs/*'` ? After plain unadorned cloning, this won't work as you will only have a single local branch available -- usually "master". See my first response to this thread. How exactly do you check out? At a bare minimum, to check out a remote branch (and go into the so-called "detached HEAD" state) you need to do git checkout origin/Version-1.3 because when you ask Git to do something with an incomplete ref name (a complete one starts with the "refs/" prefix and follows an appropriate "namespace" such as "refs/heads/whatever" for a local branch (head) named "whatever" or "refs/tags/foo" for a tag "foo" or "refs/remotes/bar/quux for a remote branch "quux" remembered for a configured remote named "bar"). Please run `git help revisions` to read the exact rules Git applies when resolving the name of a ref. All in all, most of the time you just do not check out remote branches because it has little sense (well, unless you're a seasoned Git user), so maybe you just look for a way to create a local branch pointing to the same commit as a remote branch of interest? If yes, you need git checkout -b foo origin/Version-1.3 It appears you has confusion over what's the difference between remote and local branches, and how they interact. If yes, consider reading [1] for a start. 1. https://git-scm.com/book/en/v2/Git-Branching-Remote-Branches -- 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.
