一、准備
去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賬號
然后等待上傳,進入你的項目頁面刷新就可以看到了