+3 votes
1 view
in Devops and Agile by (25.5k points)

I'm not sure why I'm unable to checkout a branch that I had worked on earlier. See the commands below (note: co is an alias for checkout):

[email protected]:~/source/unstilted$ git branch -a

* develop

  feature/datts_right

  feature/user_controlled_menu

  feature/user_controlled_site_layouts

  master

  remotes/origin/HEAD -> origin/master

  remotes/origin/develop

  remotes/origin/feature/datts_right

  remotes/origin/master

[email protected]:~/source/unstilted$ git co feature/user_controlled_site_layouts 

error: pathspec 'feature/user_controlled_site_layouts' did not match any file(s) known to git.

I'm not sure what it means, and I can't seem to find anything I can understand on Google.

How do I checkout that branch, and what may I have done to break this?

1 Answer

+3 votes
by (42.7k points)
edited by

For this question, you need to try 

git fetch

So that your local repository gets all the new information from github. It just takes the information about new branches and actual code and it works fine after:

git checkout

This will help you to check out your branch.

Check out this video for git tutorial:

by (20k points)
If you have deleted a branch with git branch -D yourbranchname and pulled/cloned again your repo, you may need to create your local branch again.
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...