暫時(shí)(保存,恢復(fù)卧蜓,刪除)工作進(jìn)度 git stash
- 在工作目錄提交過(guò)的文件做下修改 然后
git status
On branch master
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: git8.md
no changes added to commit (use "git add" and/or "git commit -a")
-
git stash save '修改了git8.md'
保存當(dāng)前進(jìn)度全封,之前做過(guò)的修改恢復(fù)到最開(kāi)始
Saved working directory and index state On master: 修改了git8.md
-
git stash list
顯示出工作進(jìn)度的一個(gè)列表
stash@{0}: On master: 修改了git8.md
-
git stash show -p stash@{0}
對(duì)比進(jìn)度跟工作目錄的區(qū)別
diff --git a/git8.md b/git8.md
index b1892a0..04f249a 100644
--- a/git8.md
+++ b/git8.md
@@ -1 +1,2 @@
### 保存琐鲁,恢復(fù),刪除工作進(jìn)度 stash
+- `git stash save '修改了git8.md'`
-
git stash apply stash@{0}
恢復(fù)保存中的工作進(jìn)度
On branch master
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: git8.md
no changes added to commit (use "git add" and/or "git commit -a")
-
git stash drop stash@{0}
刪除工作進(jìn)度
-
git stash list
上次保存的工作進(jìn)度就不存在了
- 另
git stash pop stash@{0}
在恢復(fù)工作進(jìn)度時(shí),可直接刪除工作進(jìn)度