Reputation: 45105
I understand (as of just now) that when I clone a repo, I don't really clone it, I just bring the master down - this is how it works, right?
So I need to checkout a remote branch with tracking, that's fine, but how do I see the remote branches to know what I can checkout?
Update
So it turns out I should see them locally using git branch -a
or -r
but I don't. So my question remains, if all my branches have been pushed to remote, how do I see them? Where are they?
Luke
Upvotes: 1
Views: 2134
Reputation: 45105
I think there are problems with the server. Obviously, there's no server product with Git so I had to use whatever I could find, so I used a simple ASP.NET Git server project available on a guy's blog.
Sometimes Git hangs and I've noticed the IIS worker process spinning at 99% which is bad news. We're all running over a VPN, too, which might be a contributing factor.
I quite regularly have to wipe the server repo and push everything again, the problem is so bad.
I'm also using the new Visual Studio 2012 Git support. This tells me all my branches are published although I don't think they were.
Having pushed all my branches again, they now show when cloned into a new folder. As I say, I think our Git setup here is broken or really not liking something about our environment.
Upvotes: 0
Reputation: 34732
I understand (as of just now) that when I clone a repo, I don't really clone it, I just bring the master down - this is how it works, right?
No. When you clone a repo, you really do clone it. You have everything related to that repo after that.
Use the command git branch -r
to list remote branches.
Edit:
Thought I could elaborate a bit more. The term "remote branch" might be a bit misleading here. Those branches are not exactly remote, they are local, but they represent the state of the remote branch when you last time did a git fetch (or pull). I hope this might clear things up for you a bit.
Upvotes: 3