原因
git push时选取的本地分支进行推送,如果推送的分支在本地分支中不存在,就会产生报错src refspec dev does not match any
解决
创建一个对应的dev branch:git checkout -b dev
- git pull时选取远程分支进行拉取,如果分支在远程分支中不存在,报错 fatal: Couldn’t find remote ref dev
v-gs@bapi-v-gs MINGW64 /d/Git/ws (master)
$ git push origin dev
error: src refspec dev does not match any.
error: failed to push some refs to 'git@github.com:ss/ws.git'
v-gs@bapi-v-gs MINGW64 /d/Git/ws (master)
$ git status
On branch master
nothing to commit, working tree clean
v-gs@bapi-v-gs MINGW64 /d/Git/ws (master)
$ git checkout -b dev
Switched to a new branch 'dev'
v-gs@bapi-v-gs MINGW64 /d/Git/ws (dev)
$ git push origin dev
Counting objects: 2, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (2/2), 527 bytes | 0 bytes/s, done.
Total 2 (delta 0), reused 2 (delta 0)
To github.com:ss/ws.git
51b41d4..1429ff7 dev -> dev