1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

git 割り込み作業が入った時(git-stash)のチートシート

Last updated at Posted at 2023-05-02

coding中に、割り込み作業を指示された事はありませんか?
コミットしないまま、 変更内容を一時的に避難するコマンドです。

must

コマンド 説明 コマンド例 or 出力例 補足
git stash save "退避メッセージ" 一時退避を行う git stash save "README更新"
git stash list 保存したstashを確認 stash@{0}: On master: README更新
git stash apply stashの値 保存内容を復旧 git stash apply 0 git stash listで、{}で囲まれた値を指定する

want

コマンド 説明 コマンド例 or 出力例 補足
git stash show stashの値 stashした内容を確認 git stash show 0 git stash listで、{}で囲まれた値を指定する
git stash drop stashの値 指定したstashを削除する git stash drop 0
git stash clear すべての退避したstashをクリアする
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?