1

I have a project I want to bring into Git.
I have my local git config complete, verified I can SSH in, and have a branch "main" setup on GitHub.
I substituted "xyz" for my actual GitHub branch.

The "git checkout" command does not appear to be creating a local branch, and no error message is issued.

git remote -v

svi     git@github.com:rboudrie/XYZ.git (fetch)
svi     git@github.com:rboudrie/XYZ.git (push)

git branch -a

remotes/xyz/main

git checkout -b newbranch

Switched to a new branch 'newbranch'

git branch -a

remotes/xyz/main

I am attempting to create a local branch, and am expecting the branch to show up in "git branch -a" (or just git branch) when done.
I used the "-a" on git branch to prove I am successfully connecting to my repo on github.com.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250

2 Answers2

0

it appears that you are only handling remote branches... when you run the first "git branch -a" the local main branch should have appeared before the remote one... weird.

try seeing current branch with git branch --show-current

John Doe
  • 1
  • 3
0

First, do not use the obsolete git checkout command, but rather git switch.

Second, when you clone your repository, your remote should be named by default "origin", not "svi"

Try and clone again, to confirm this would work:

git clone git@github.com:rboudrie/XYZ.git
cd XYZ
git remote -v
git switch -c newBranch
git branch -avv
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250