I'm using git branch -a to list all my remote branches.
remotes/origin/feature1
remotes/origin/feature2
remotes/client/feature1
remotes/client/feature2
I pick one and checkout client/feature2 to it and that puts me in a detached head state which seems like I've checked out to a tag somewhere in history?
Does "git branch -a" list tags?
No, it lists branches.
$ git checkout client/feature2
... puts me in a detached head state which seems like I've checked out to a tag somewhere in history?
But a remote branch does just point to a commit. You can't use it as a local branch, to check it out and work on it.
What you can do instead is create a local tracking branch and work on that - the remote branch is updated when you push.
$ git checkout -b feature2 client/feature2
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With