git 如何用指令创建远程仓库
创建仓库不一定要登录github网站,可以在命令行操作error: src refspec master报错
文章共168字 · 阅读需要大约1分钟
一键AI生成摘要,助你高效阅读
问答
·
创建仓库不一定要登录github网站,我们实际上可以在本地通过命令行进行操作
git init //git add . 和 git commit 也是必要的, 这样做会生成master主分支,否则
//后续push会有报错 error: src refspec master does not match any.
curl -u '用户名' https://api.github.com/user/repos -d '{"name":"仓库名"}'
git remote add origin https://github.com/用户名/仓库名.git
//或者使用ssh,避免输入密码
//git remote add origin git@github.com:用户名/仓库名.git
git push origin master
更多推荐
已为社区贡献2条内容
所有评论(0)