git仓库创建
登录/注册git github官网https://github.com/
注意:记住你的用户名、密码、邮箱
参考:https://blog.csdn.net/liuweixiao520/article/details/78971221
打开Git Bash,操作如下:
1.git config --global user.name “xxx”
2.git config --global user.email “xxx@gmail.com”
3.git init
4.git add build.gradle
5.git add app
6.git add .
7.git commit -m “first commit”
8.ssh-keygen -t rsa -C “xxx@example.com” 或 ssh-keygen
然后一路回车。这时你就会在用户下的.ssh目录里找到id_rsa和id_rsa.pub这两个文件
9.进入github官网https://github.com/
10.最右边图片→Setting→SSH and GPG keys→New SSH key
Title:随便写(是你项目的名字)
Key:把id_rsa.pub中的内容 全部 粘贴进去
Add SSH key
11.+→New repository
Repository name:随便(是你项目的名字)
Create repository
12.git remote add origin 生成的https网址.git
例:git remote add origin https://github.com/shirley9264/aaa.git
13.第一次上传代码:git push -u origin master
非第一次上传(即更新后再次上传):git push origin master