[GIT] stash
https://git-scm.com/book/zh-tw/v1/Git-%E5%B7%A5%E5%85%B7-%E5%84%B2%E8%97%8F-Stashing 6.3 Git 工具 - 儲藏 (Stashing) 儲藏 (Stashing) 經常有這樣的事情發生,當你正在進行專案中某一部分的工作,裡面的東西處於一個比較雜亂的狀態,而你想轉到其他分支上進行一些工作。問題是,你不想只為了待會要回到這個工作點,就把做到一半的工作進行提交。解決這個問題的辦法就是 git stash 命令。 「儲藏」可以獲取你工作目錄的 dirty state——也就是你修改過的被追蹤檔和暫存的變更——並將它保存到一個未完成變更的堆疊(stack)中,隨時可以重新應用。 儲藏你的工作 為了演示這一功能,你可以進入你的專案,在一些檔上進行工作,有可能還暫存其中一個變更。如果你執行 git status ,你可以看到你的 dirty state: $ git status # On branch master # Changes to be committed: # (use "git reset HEAD <file>..." to unstage) # # modified: index.html # # Changes not staged for commit: # (use "git add <file>..." to update what will be committed) # # modified: lib/simplegit.rb # 現在你想切換分支,但是你還不想提交你正在進行中的工作;所以你儲藏這些變更。為了往堆疊推送一個新的儲藏,執行 git stash : $ git stash Saved working directory and index state \ "WIP on master: 049d078 added the index file" HEAD is now at 049d078 added the index file (To restore them type ...