git 一次避難

作業が途中でコミットしたくないけど別のブランチで作業しないといけない。 そういう時に作業を一時避難する。

作業を一次避難する

git stash
git stash save

作業した作業を確認する

git stash list

避難した作業を復元する

git stash apply

ステージの状況も復元する

git stash apply --index

特定の作業を復元する

git stash apply [スタッシュ名]
git stash apply stash@{1}

*applyは適用するという意味

避難した作業を削除しよう

git stash drop

特定の作業を削除する

git stash drop [スタッシュ名]
git stash drop srash@{1}

全作業を削除する

git stash clear