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

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

出現此error緣由是由於對於新建的branch沒有及時更新到本地git的branch,因此出現沒有找到相應分支的錯誤git

  • 解決策

# 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
 github

# 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.fetch

相關文章
相關標籤/搜索