git执行push操作,将本地修改推送到gitee远程仓库时,报错:
error: src refspec master does not match any
error: failed to push some refs to 'gitee.com:XXX/XXX.git'
进一步执行以下强制推送命令:
$ git push --set-upstream origin main
[session-b94f3085] Auth error: DeployKey does not support push code
fatal: Could not read from remote repository.Please make sure you have the correct access rights
and the repository exists.
报错并显示DeployKey无法push,这可能说明DeployKey无push权限。
可以进入gitee的对应仓库进一步确认是否是以上问题,部署公钥管理页确实显示只能clone或pull,要想执行写操作,需要添加个人公钥
点击添加个人公钥,添加本地生成的公钥后就可以本地执行push到远程gitee仓库了。