创建仓库不一定要登录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
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐