-
在git中新建一個(gè)repository
Paste_Image.png
最后點(diǎn)擊create reposity
- 在windows在安裝git
git官網(wǎng):https://git-scm.com/
安裝教程可參考:https://jingyan.baidu.com/article/020278117cbe921bcc9ce51c.html
3.接下來就是將本地文件上傳到git倉庫
<1>在要上傳的文件中:點(diǎn)擊右鍵-Git Bash Here

Paste_Image.png
<2>初始化一個(gè)倉庫,初始化后,文件中就會出現(xiàn)一個(gè).git文件夾
git init

Paste_Image.png
<3>添加你要上傳的文件
git add .

Paste_Image.png
<4>將要添加的文件提交到緩存區(qū)
git commit -m "str"

Paste_Image.png
注:如果在提交的時(shí)候遇上了以下問題

Paste_Image.png
解決方式如下:
依次輸入兩段命令行:
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
eg:git config --global XiongShasha.email "XiongShasha@mail.ccnu.edu.cn"
<5>鏈接遠(yuǎn)端倉庫
git remote add origin 倉庫地址

Paste_Image.png
<6>將緩存區(qū)的文件提交到遠(yuǎn)端倉庫
git push -u origin master
提示輸入自己github的賬號和密碼

Paste_Image.png
