- 20150927 [學習筆記] Git版本控制(6)
- 整理自第 07 天:解析 Git 資料結構 - 索引結構
- [基本概念] 關於索引
- [內容摘要]
- (一)索引的狀態
- 1. untracked (未追蹤的)
- 2. unmodified (未修改的)
- 3. modified (已修改的)
- 4. staged (等待被 commit 的)
- (二)索引的操作
- [ 圖解 ] 指令之間的關係
- < 指令1 > git status 顯示工作目錄的狀態
- < 指令2 > git add 將變更寫入到索引
- < 指令3 > git rm 刪除索引裡的檔案
- < 指令4 > git mv 變更索引裡的檔案名稱
- < 指令5 > git commit 提交版本
- < 指令6 > git ls-files 列出索引中的檔案
- (三)Git 指令之間的關係 (圖解)
整理自第 07 天:解析 Git 資料結構 - 索引結構
(一)索引的狀態
(二)索引的操作
G:\git-demo>git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# new file: c.txt
#
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: a.txt
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# b.txt
(三)Git 指令之間的關係 (圖解)