93
80

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 5 years have passed since last update.

忘れがちなgit stashをコマンドから実行する際のメモ書き

Last updated at Posted at 2015-02-25

SourceTreeでgit stashすると、重かったりして面倒なのでよくやる処理をすべてコマンドから行えるようにまとめました。

一時退避

git stash

退避内容を一覧表示

git stash list
stash@{0}: hoge0
stash@{1}: hoge1
stash@{2}: hoge2

最新の退避内容を戻す

git stash pop

退避対象のファイルの一覧を表示する

git stash show stash@{0}

退避対象の変更内容を表示する

git stash show -p stash@{0}
-  $user = '1'; // 削除した行
-
+  $add = 'hoge'; // ここが追加した行

指定の退避内容を戻す

git stash pop stash@{0}

退避内容を全削除する

git stash clear

指定の退避内容を削除する

git stash drop stash@{0}
93
80
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
93
80

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?