Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Git push命令,遇到错误-致命:refspec无效';https://github.......git'_Git_Push_Refspec - Fatal编程技术网

Git push命令,遇到错误-致命:refspec无效';https://github.......git'

Git push命令,遇到错误-致命:refspec无效';https://github.......git',git,push,refspec,Git,Push,Refspec,我在master分支中,添加了远程分支,之后无法将数据从本地推送到远程: $ Git remote add master https://....git $ Git push origin master https:// ...git Fatal: invalid refspec 'https://...git' 您应该“origin,而不是master: git remote add origin https://... git remote remove master git push

我在
master
分支中,添加了远程分支,之后无法将数据从本地推送到远程:

$ Git remote add master https://....git

$ Git push origin master https:// ...git
Fatal: invalid refspec 'https://...git'
您应该“
origin
,而不是
master

git remote add origin https://...
git remote remove master
git push -u origin master

通过将身份验证方法从HTTPS更改为SSH,我的问题得到了解决

Github SSH密钥指南:

在github()中创建新的SSH密钥