Home > OS >  How to git checkout on new branch [closed]
How to git checkout on new branch [closed]

Time:09-24

UPDATE : I DON'T WANT TO CHECKOUT A REMOTE BRANCH so it's not a duplicate question !

I tried

git checkout testbranch 05130ebc

But I get this error :

pathspec 'testbranch' did not match any file(s) known to git

CodePudding user response:

You should use:

git checkout -b testbranch 05130ebc

This will create branch testbranch at commit 05130ebc and check it out.

CodePudding user response:

Do a 'git checkout -b testbranch', this will create a new branch in the GIT repository.

If you have already created the branch then do:

'git fetch'
'git checkout testbranch'
  •  Tags:  
  • git
  • Related