I created a feature a few weeks ago with git and did some work on it and had to stop. Now I want to start working on it again but each time I use git branch -a to get the name of the available branches I can see it as
remotes/origin/feature/upgrade-free-premium
but when I run git checkout upgrade-free-premium I get the following error.
error: pathspec 'upgrade-free-premium' did not match any file(s) known to git.
Could someone help me solve this?
Try this:
In your case, the branch is a remote one. You need to specify from which branch you want to checkout: so the correct branch name is
origin/feature/upgrade-free-premium. This, because other origins can have the same branch name, so you need to specify the full name.The
-bis necessary to create a local branch to track the remote branch.