如何上传项目至GitHub

1.下载

  https://gitforwindows.org/

2.打开Git Bash

   把git绑定到GitHub

3.打开GitHub登陆后

  1.   点击settings
  2.   点击SSH and GPG keys
  3.   点击 New SSH key
  4.   输入title

4.找key

  打开Git Bash 输入  

$ ssh-keygen -t rsa -C '你的注册邮箱'
  1.   回车提示输入密码,再回车两次
  2.   从提示路径里找到对应的.ssh文件
  3.   打开对应文件,里面有两个id_rsa,打开带pub的id_rsa(里面有注册邮箱),复制代码

5.把复制的key放到网页里面,点击确定

6.测试有没有绑定成功

  输入ssh -T [email protected]

  当弹出提示 You‘ve successfully authenticated 就绑定成功

7.设置用户信息(用于再提交的时候显示你的信息)

  查看 git config --list

  设置用户名:输入 git config --global user.name '用户名'

  设置用户邮箱: 输入 git config --global user.email '邮箱'

8.新建项目

  1.   点击网站右上角加号 +
  2.   点击 New repository
  3.   在 Repository name 输入项目名称
  4.   在 Description 输入项目描述
  5.   在Initialize this repository with a README 勾选

9.把项目放到本地

$ git clone [email protected]:XXXX/test1.git
// XXXX 是你的GitHub注册名称

10.把本地的代码上传至GitHub

  1.放到暂存区:

    上传单文件: git add 文件名 

    上传多文件: git  add .

  2.放到版本区

    git commit -m '注释'

  3.添加到GitHub

    git push origin master

  

猜你喜欢

转载自www.cnblogs.com/shengnan-2017/p/9260032.html