現在のブランチAから、移動したいブランチBへgit check outをしたところ、このようなエラーがでた。
error: Your local changes to the following files would be overwritten by checkout:
ファイル名
Please commit your changes or stash them before you switch branches.
Aborting
解決法
「現在のブランチではコミットはしたくない」というときに。
stash
で、コミットしていない変更を一時退避させ、ブランチの切り替えを行うことができる。
git stash
メッセージをつけて一時退避させたい時は。
git stash save “message”
stash
そのほかのコマンド。
git stash list #一時退避の一覧表示
git stash pop #一時退避を戻す(stash popで、stashは破棄される)
git stash clear #一時退避しているものを全削除する