個人小小整理
$ git config --global user.name "OOOOOOO"
$ git config --global user.email "OOOOO@OOOOOOO"
$ git config --list
$ git config --global alias.'別名(alias)' '指令'
全新開始~
$ cd 切換過去$ git init
會在該目錄中建立 .git 資料夾
本來就有專案~
$ cd 切換到專案目錄從 Github 上抓~(Homework都是用這個!!!)
$ cd 切換到要進行專案的目錄$ git clone 'url'
會在該目錄中建立一個該 Repository 的資料夾
簡易概念圖

常用指令
| 指令 | 功能說明 |
|---|---|
$ git clone |
複製儲存庫 |
$ git init(initiate) |
初始化版本庫 |
$ git status |
當前的 Git 狀態(不時就打一下這個指令做確認) |
$ git add |
加入追蹤(tracking) |
$ git rm(remove) |
刪除檔案 |
$ git commit |
提交目前暫存區的修改,會產生log紀錄 |
$ git log |
查看所有歷史記錄 |
$ git push |
提取本地儲存庫的檔案並推送至遠端儲存庫 |
$ git branch |
列出分支 |
指令詳細介紹
$ git clone$ git clone 'url'$ git clone 'url' 'name'$ git add$ git add 'file'$ git add -u$ git add --all或是$ git add .$ git add -i$ git commit$ git commit$ git commit -m 'message'$ git remote$ git remote (show)$ git remote -v$ git push$ git push$ git push 'remote' 'branch'$ git push的作用等於$ git push 'remote' 'branch'
$ git branch$ git branch$ git branch -r$ git branch -a$ git branch -v