执行git push命令报错“fatal: protocol 'git@https' is not supported”求助
解决Git推送错误:fatal: protocol 'git@https' is not supported
先检查当前远程仓库URL,确认格式问题:
git remote -v你会看到类似
git@https://xxx.git的错误格式,这是把SSH和HTTPS协议混写导致的核心问题。修正远程仓库URL,根据你常用的协议二选一:
- 若使用HTTPS协议,执行:
示例:git remote set-url origin https://[你的仓库完整地址].gitgit remote set-url origin https://github.com/yourname/your-repo.git - 若使用SSH协议,执行:
示例:git remote set-url origin git@[你的仓库完整地址].gitgit remote set-url origin git@github.com:yourname/your-repo.git
- 若使用HTTPS协议,执行:
重新执行推送命令:
git push -u origin master
内容的提问来源于stack exchange,提问作者Anil Garad
相关产品推荐
相关产品推荐

