git 如何用指令创建远程仓库

来源:互联网 发布:ecshop小程序源码 编辑:程序博客网 时间:2024/05/20 23:29

创建仓库不一定要登录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:用户名/仓库名.gitgit push origin master
原创粉丝点击