I want to do some funky stuff with a project on github (not mine). So I want to basically clone it but I don't want to have a working tree... so this is what I do: I create a bare repo locally, then I added a remote to the github repo. I fetched, I get all the stuff that that repo contains.... I am a happy guy..... until I want to check the branches that are available:
$ git branch -a
$
Ok... that is not what I was expecting. If I try to check any branch from the repo (that I know is there), I just get git to tell me the reference doesn't exist:
$ git show --summary origin/master
fatal: ambiguous argument 'origin/master': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
How do I address branches (or actually anything) from the remote repo from my bare repo?
Update
My assumptions that git should be able to handle this is actually correct. It does manage it correctly... however, because it is a big project, git failed while running the fetch after adding the remote... and that error message I did not catch before. :-O
$ git fetch upstream
remote: Enumerating objects: 60400, done.
remote: Counting objects: 100% (60400/60400), done.
remote: Compressing objects: 100% (32/32), done.
Receiving objects: 100% (4133663/4133663), 1.41 GiB | 12.29 MiB/s, done.
remote: Total 4133663 (delta 60370), reused 60389 (delta 60368), pack-reused 4073263
Connection to github.com closed by remote host.
Resolving deltas: 100% (3134856/3134856), done.
So... all in all, it's my fault, apparently.