0 votes
1 view
in DevOps and Agile by (28.4k 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 (20k 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

Welcome to Intellipaat Community. Get your technical queries answered by top developers !