天天看點

作業二/Git的安裝以及使用

作業要求來自https://edu.cnblogs.com/campus/gzcc/GZCC-16SE2/homework/2097

GitHub位址 https://github.com/201606120084

1.下載下傳安裝配置使用者名和郵箱

作業二/Git的安裝以及使用

建立使用者名    $ git config --global user.name "username"     --unilee84                 

建立郵箱位址    $ git config --global user.email  "email"        [email protected]                  

檢視使用者名    $ git config user.name                                      --unilee84   

檢視郵箱    $ git config user.email                                           [email protected]   

2. 建立工作目錄并通過git init指令把這個目錄變成Git可以管理的倉庫

作業二/Git的安裝以及使用

mkdir  lb84    建立一個檔案夾并且命名為lb84

作業二/Git的安裝以及使用

改變Git管理的倉庫位址    $ git init   改變為lb84

3. 在工作目錄下準備文本檔案,建議下載下傳Notepad++代替記事本

作業二/Git的安裝以及使用

4. 組合用git add、git commit、git status 把檔案送出到倉庫

作業二/Git的安裝以及使用

檢查目前檔案狀态    $ git status 

添加檔案到倉庫    $ git add

作業二/Git的安裝以及使用

送出檔案到倉庫    $ git commit

5. 練習送出三個或以上的版本

作業二/Git的安裝以及使用
作業二/Git的安裝以及使用
作業二/Git的安裝以及使用

6. 組合使用git diff、git log、git reset指令進行版本管理與回退,觀察檔案變化 

作業二/Git的安裝以及使用

 這一步弄了很久都實作不了

7. 将Git倉庫托管到GitHub網站上

作業二/Git的安裝以及使用
作業二/Git的安裝以及使用

8. 把本地倉庫的内容推送到GitHub倉庫

作業二/Git的安裝以及使用
作業二/Git的安裝以及使用

建立了本地倉庫與遠端庫關聯  $ git remote add origin [email protected]/201606120084

本地庫的所有内容推送到遠端庫  $ git push -u origin master