git push 报src refspec xxx does not match any的错误

远程分支branch_a是其他人建的,我现在要把我自己分支的修改,提到这个分支上去。

初次提交将其提交到本地仓库

git add filename

git commit -m "add features"

提交到远程仓库

git push origin branch_a

错误信息如下:

error: src refspec xxx does not match any.

error: failed to push some refs to ‘git@xxxxxxx’

执行git pull origin xxx ,pull是可以正常拉取的。

解决方案:

git push origin HEAD:branch

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。