## 參考資料:
* [保存當前工作現場](http://my.oschina.net/u/2298961/blog/381728)
* [git stash官方API](https://git-scm.com/docs/git-stash)
## 實踐總結:
* `git stash`操作之后會將 **工作區** 和 **暫存區** 的改動放到 **工作現場**
* '工作現場' 是一種中文翻譯, 官方的叫法是'dirty working directory'
> Stash the changes in a dirty working directory away
* **工作現場**獨立存在于所有分支, 也就是一個git 項目中只有一個**工作現場**,即使這個項目中有N個分支;(所以如果想將A分支改動的代碼切換到B分支,不妨試用git stash)

* 如果有**修改**的文件從**暫存區間**中放入**工作現場**(git stash), 當再次從**工作現場**取出時(git stash pop), 該修改的文件會變回在**工作區間**;(**新增**的文件則正常恢復到**暫存區間**)
## git stash 常用指令:
* git stash
* git stash save "這些是注釋啦"
* 新增工作現場(將當前的所有改動全部放入工作現場), `git stash`的默認注釋為當前分支上一次commit的注釋
* git stash list
* 顯示工作現場列表
* git stash clear
* 清空工作現場列表(慎操作!)
* git stash drop
* git stash drop stash@{0}
* 刪除某一個工作現場,默認刪除最新工作現場:`git stash drop` = `git stash drop stash@{0}`
* git stash pop
* git stash pop stash@{0}
* git stash pop --index stash@{0}
* 恢復工作現場的代碼(并刪除),默認恢復最新工作現場:`git stash pop` = `git stash pop stash@{0}`, --index 參數:不僅恢復工作區,還恢復暫存區;
* git stash apply
* git stash apply --index stash@{0}
* 恢復工作現場的代碼(不刪除),默認恢復最新工作現場:`git stash apply` = `git stash apply --index stash@{0}`, --index 參數:不僅恢復工作區,還恢復暫存區
## 相關指令:
* [git_status.md](http://www.hmoore.net/wteamxq/git_rank/276485) 查看當前代碼狀態指令: 使用我這個指令,只是為了確認放入 **工作現場** 是否成功。