一.git本地
????????1.安裝git
????????????出現git ui和git bash圖標
????????2.配置git
????????????$ git config --global user.name "My Name"
????????????$ git config --global user.email myEmail@example.com
????????3.創建倉庫
????????????$ cd desktop/test-git
????????????$ git init
????????4.檢查狀態
????????????$ git status
????????5.暫存
????????????$ git add (-a提交目錄下的所有文件)
????????6.提交
????????????$ git commit -m ‘說明’
二.git遠程端
????????1.鏈接遠端倉庫
????????????$ git remote add origin git@github.com:ALISA0710/BigData.git (git倉地址)
????????2.上傳到服務器
????????????$ git push origin master
????????3.克隆倉庫
????????????$ git clone git@github.com:ALISA0710/BigData.git
????????4.從服務器拉取代碼
????????????$ git pull origin master
????????分支
? ? ? ? 1.創建分支
????????????$ git branch
????????2.切換分支
????????????$ git checkout
????????3.合并分支
????????????$ git merge
三.比較版本
????????1.比對兩個不同的提交之間的差別
????????????$ git log (每次提交都有唯一的ID)
????????2.回滾某個文件到之前版本
????????????$ git checkout (ID 文件名)
????????3.回滾提交
????????????$ git revert