一、准备
去Github官网https://github.com/注册一个账号
,然后新建一个库
这个时候仓库已经创建成功,点击刚创建好的仓库,会看见如下内容:
下载GIT(https://pc.qq.com/detail/13/detail_22693.html)
在git bash里面进行用户名和邮箱设置
git config --global user.name "随便取一个用户名" (回车)
git config --global user.email "输入你自己的邮箱" (回车)
表示以后用这个身份上传
创建仓库
创建一个文件夹,里面新增四个文件,进入文件夹内,右键【Git Bash Here】,
x@GW02-AC2017-019 MINGW64 /e/gitPro
$ git init
Initialized empty Git repository in E:/gitPro/.git/
x@GW02-AC2017-019 MINGW64 /e/gitPro (master)
$ git add .
x@GW02-AC2017-019 MINGW64 /e/gitPro (master)
$ git commit -m "测试1234"
[master (root-commit) 46e17b0] 测试1234
4 files changed, 0 insertions(+), 0 deletions(-)
create mode 100644 1.txt
create mode 100644 2.txt
create mode 100644 3.txt
create mode 100644 4.txt
这时候找到你的安装Git工具的路径,来获取ssh:
x@GW02-AC2017-019 MINGW64 /
$ git config --global user.name "nuoyan"
x@GW02-AC2017-019 MINGW64 /
$ git config --global user.email "3078643385@qq.com"
x@GW02-AC2017-019 MINGW64 /
$ cd ~/.ssh
x@GW02-AC2017-019 MINGW64 ~/.ssh
$ ssh-keygen -t rsa -C "3078643385@qq.com"
会看到你的ssh生成路径,输入两次密码
打开.pub的文件,复制里面的内容
粘贴至
这时候我们继续上传文件
x@GW02-AC2017-019 MINGW64 /e/gitPro
$ git init
Initialized empty Git repository in E:/gitPro/.git/
x@GW02-AC2017-019 MINGW64 /e/gitPro (master)
$ git add .
x@GW02-AC2017-019 MINGW64 /e/gitPro (master)
$ git commit -m "测试1234"
[master (root-commit) 46e17b0] 测试1234
4 files changed, 0 insertions(+), 0 deletions(-)
create mode 100644 1.txt
create mode 100644 2.txt
create mode 100644 3.txt
create mode 100644 4.txt
x@GW02-AC2017-019 MINGW64 /e/gitPro (master)
$ ^C
x@GW02-AC2017-019 MINGW64 /e/gitPro (master)
$ git remote add origin https://github.com/xuyumengnuoyan/BYSJ.git
x@GW02-AC2017-019 MINGW64 /e/gitPro (master)
$ git push -u origin master
Enumerating objects: 3, done.
Counting objects: 100% (3/3), done.
Delta compression using up to 4 threads
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 231 bytes | 231.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To https://github.com/xuyumengnuoyan/BYSJ.git
* [new branch] master -> master
Branch 'master' set up to track remote branch 'master' from 'origin'.
过程中会让你登录你的github账号
然后等待上传,进入你的项目页面刷新就可以看到了