执行git status
向我展示
On branch ashwini-rr
Your branch is ahead of 'origin/ashwini-rate-recommendations' by 8 commits.
(use "git push" to publish your local commits)
nothing to commit, working directory clean
但是git push origin ashwini-rate-recommendations
正在向我显示以下错误:
error: src refspec ashwini-rate-recommendations does not match any.
error: failed to push some refs to 'git@github.com:xxxxx/xxxxx.git'
正在运行git show-ref
会显示如下内容:
XXXXXXXXXXXX refs/heads/ashwini-rr
XXXXXXXXXXXX refs/heads/dbv
XXXXXXXXXXXX refs/remotes/origin/HEAD
XXXXXXXXXXXX refs/remotes/origin/ashwini-rate-recommendations
git --version
给了我git version 2.3.2 (Apple Git-55)
push.default=matching
我无法弄清楚为什么这会导致error: src refspec ashwini-rate-recommendations does not match any.
,即使它不是第一次提交的情况。感谢。
答案 0 :(得分:0)
您当地的分支机构名为ashwini-rr,您正在推动它的ashwini-rate-recommended。
尝试跑步:
git push origin ashwini-rr:ashwini-rate-recommendations.
答案 1 :(得分:0)
你需要的是告诉git在ashwini-rate-recommendations分支推送什么:
git push origin ashwini-rr:ashwini-rate-recommendations
或者,由于跟踪分支,只需:
git push