0

I've worked with Git and VSCode before, and done so together; but I never tried to create a secondary branch (The one that isn't master), so today that I decided to do so, I create a new branch called test, and VSCode shows me I'm working in the test branch, nothing bad here.

The problem comes when I try to navigate between my branches (test and master); there is just one: test.

enter image description here

I have tried several methods, but none of them work; and yes, I have the path for VSCode and Windows configured properly, so it isn't that.

Also as you can see on the SS above, in the console it shows this: fatal: ambiguous 'test': unknown revision or path not in the working tree.

If I understand it correctly, that means it doesn't even recognize that the branch exists (Please forgive me if I misunderstood it, I'm not good at Git)

Question: Does someone know how I can correct this interesting behavior? I've been stuck with this for hours and haven't gotten anywhere.

Community
  • 1
  • 1
Rolin Azmitia
  • 129
  • 1
  • 2
  • 14

1 Answers1

1

Well this is weird, after posting this I thought of using the actual Windows cmd and write Git in it, so I went with this:

$ git checkout -b master

Basically I re-created the master branch via commands. Before when I asked it to show me the existing branches it would go like this:

$ git show-branch
No revs to be shown.

But after I executed the checkout command, it spits:

$ git show-branch --I replaced the test branch, for the afk, it's the same thing--
! [afk] Added html
 * [master] Added html
--
+* [afk] Added html

Which if I am not mistaken, says afk is now the master branch, and master is now a sub-branch... It's still bad, but now it does show both branches in VSCode:

enter image description here

So apparently, the solution is to manually create at least 1 branch in the console and then you can continue doing so with VSCode without problems.

Still, I would like to know if someone has a better answer :).

Community
  • 1
  • 1
Rolin Azmitia
  • 129
  • 1
  • 2
  • 14