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

为什么80%的码农都做不了架构师?>>>   hot3.png

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

你可能感兴趣的:(error: pathspec "" did not match any file(s) known to git.)