Problem Description
After using git
the branch created in the remote warehouse, I want to switch to the branch just created locally, and the following error is reported:
$ git checkout ‘fds’
error: pathspec 'fds' did not match any file(s) known to git
Let's translate it:
错误:pathspec“fds”与git已知的任何文件不匹配!
it means that the branch just created remotely cannot be found locally!
Cause Analysis:
The cache of the remote warehouse in the local warehouse is not updated, we need to update it manually.
solution:
Use git fetch origin
the or git remote update origin --prune
command directly to update the cache.
Then use view git branch -r
to see the new branch!