Created a branch in the git remote warehouse, but can't find it locally?

Problem Description

After using gitthe 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 originthe or git remote update origin --prunecommand directly to update the cache.

Then use view git branch -rto see the new branch!

Guess you like

Origin blog.csdn.net/weixin_61102579/article/details/130202353