Sublime Forum

SM and Branches

#1

There is a remote branch “development” for one of my packages on github.
However, asking SM to check out that branch doesn’t work (as expected, or perhaps at all).
I type in the branch name, hit return, and nothing happens whatsoever.
What’s up with that?

0 Likes

#2

When I use command-line git to checkout that branch, it shows up in SM. Then I can pick it from the dropdown list.

0 Likes

#3

What do you do exactly? As in, which command do you run and how do you run it.

0 Likes

#4

I clone the package. It comes out as “master”. Then I want to switch to “development”, so I go to Repository/Check Out Branch. I type in “development” (without the quotes) and hit return. Nothing happens: no reaction from the GUI.

0 Likes

#5

Try “Checkout Remote Branch” instead (or “Create Branch From Remote Branch”, if you want a local branch from it).

0 Likes

#6

But that did git checkout refs/remotes/origin/development instead of git checkout development? Is that okay?

0 Likes

#7

Yes, because after cloning the development branch doesn’t exist yet for you locally. I think git automatically infers from git checkout development that you want the remote development, which is refs/remotes/origin/development and does that automatically.

When you checkout without creating a branch (which “Create Branch From Remote Branch” would do), you are in detached HEAD state. I wasn’t able to fin a satisfactory explanation of this with a quick search, but for the time being this will do.

1 Like