Git上传手把手创建

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值