Does git branch -a strip tags?

I use git branch -a

to list all my remote branches.

remotes/origin/feature1
remotes/origin/feature2
remotes/client/feature1
remotes/client/feature2

      

I choose one and for it checkout client/feature2

, and that puts me in a state detached head

similar to that I checked a tag somewhere in history?

+3


source to share


1 answer


Does git branch -a "

No, it lists branches.


$ git checkout client/feature2

      



... puts me in a separate head state, looks like I checked a tag somewhere in history?

But the remote branch just points to a commit. You cannot use it as a local branch to check out and work on it.

Instead, you can create a local tracking branch and work on it - the remote branch is updated on push.

$ git checkout -b feature2 client/feature2

      

+5


source







All Articles