LoginSignup
18
21

More than 5 years have passed since last update.

作業中にブランチを切り替えたい場合

Last updated at Posted at 2014-01-17

作業途中とかに中途半端にコミットしたくなくて別ブランチに切り替えたい、
現在の作業を一旦中断して同ブランチで取り急ぎの作業をする場合とかに使う。

作業を一旦退避させる

$ git stash save 'message'

保存した作業の一覧を確認する

$ git stash list

作業を復元する

# 最新の状態に戻す場合
$ git stash pop

# 指定の状態に戻す場合
$ git stash pop stash@{n}

参考リンク

http://kotazi.com/archives/1162/
http://transitive.info/article/git/command/stash/
http://git-scm.com/book/ja/Git-%E3%81%AE%E3%81%95%E3%81%BE%E3%81%96%E3%81%BE%E3%81%AA%E3%83%84%E3%83%BC%E3%83%AB-%E4%BD%9C%E6%A5%AD%E3%82%92%E9%9A%A0%E3%81%99

18
21
1

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
18
21