Reputation: 331
I am trying to fetch source code from a repository but when I run command to fetch the source code I get an error which says "error pathspec did not match any files known to git".
Following is the sequence of command that i run to fetch source code.
$ git remote add origin git@....
$ git fetch
$ git checkout test
Upvotes: 2
Views: 669
Reputation: 124704
Git tries to resolve git checkout test
like this:
origin/test
, then create a local branch from it and checkout (equivalent to git checkout -b test origin/test
If none of the above match, then Git gives the error:
error: pathspec 'test' did not match any file(s) known to git.
I'm not sure what you were trying to do here. If you wanted to checkout the "test" branch, it seems it doesn't exist. Check what branches you have with git branch -a
. If you wanted to checkout a file/dir, it doesn't exist. Check what files you have with git ls-files
.
Upvotes: 2