当前位置:   article > 正文

error: pathspec "" did not match any file(s) known to git.

error: pathspec '–recursive' did not match any file(s) known to git.

error: pathspec "" did not match any file(s) known to git.

出现此error原因是因为对于新建的branch没有及时更新到本地git的branch,所以出现没有找到相应分支的错误

  • 解决策

# git remote update   (更新远程分支到本地)
Fetching origin
remote: Counting objects: 47, done.
remote: Compressing objects: 100% (37/37), done.
remote: Total 47 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (47/47), done.
From https://github.com/DreamArts/YUKARi
   a0fdf6c..6b22e27  ios/Swift_3.0 -> origin/ios/Swift_3.0
 * [new branch]      main/feature/juan/layout_caseView -> origin/main/feature/juan/layout_caseView
 

# git fetch(获取远程分支到本地)
# git checkout main/feature/juan/layout_caseView(把代码切换到新建的分支上面)
M    controllers/ipad/ctrl_definition.js
D    logs/.gitkeep
Branch main/feature/juan/layout_caseView set up to track remote branch main/feature/juan/layout_caseView from origin.
Switched to a new branch 'main/feature/juan/layout_caseView'

# git pull(更新代码)
Already up-to-date.

 

转载于:https://my.oschina.net/sai20150901/blog/752734

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/运维做开发/article/detail/927368
推荐阅读
相关标签
  

闽ICP备14008679号