Git checkout '...' always results in an error: pathspec '...' does not match any file known to git

We have a problem with our development branch. In short, I deleted the branch and recreated it from master. However, every time we create a new clone to create a repository and checkout, we get the following:

$ git checkout development
error: pathspec 'development' did not match any file(s) known to git.

      

I can solve the problem using Gregory McIntyre's answer:

Git: Unable to checkout branch - error: pathspec '...' does not match any file known to git

git checkout -t -b development origin/development

      

Then I can use the branch as usual.

However, the next time we clone the repository, we will have the same problem and have to use the same fix.

This is just a development branch having this problem, other branches work as expected after a new clone:

$ git checkout staging
Branch staging set up to track remote branch staging from origin.
Switched to a new branch 'staging'

      

Is it possible to fix the development branch so that a workaround is not required?

+3


source to share





All Articles