Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in DevOps and Agile by (27.5k points)

I am a new user of Git. I have forked a repository called Spoon-Knife (available for practicing forking with Git). Then, I cloned it locally by running

git clone https://github.com/rohinichoudhary/Spoon-Knife.git

This repository contains three branches, i.e.

  • master,
  • test-branch,
  • change-the-title.

When I run git branch, it only shows *master, not the remaining two branches. And when I run

git checkout test-branch

I get the following error:

error: pathspec 'test-branch' did not match any file(s) known to git.

Why is this happening? How can I solve this problem?

1 Answer

0 votes
by (19.4k points)

Your git branch can be solved just by a few simple commands. Follow the steps given below.

$ git remote update

$ git fetch

$ git checkout --track origin/test-branch

Browse Categories

...