LoginSignup
0
0

git stashのコマンドを忘れてしまう時があるので
コマンドを備忘録として残します。

基本的な使い方

  1. 変更を一時保存する

    git stash
    
  2. 一時保存した変更を一覧表示する

    git stash list
    
  3. 最新のスタッシュを適用する

    git stash apply
    
  4. 特定のスタッシュを適用する

    git stash apply stash@{n}
    
  5. 最新のスタッシュを適用し、それを削除する

    git stash pop
    
  6. 特定のスタッシュを適用し、それを削除する

    git stash pop stash@{n}
    
  7. 最新のスタッシュを削除する

    git stash drop
    
  8. 特定のスタッシュを削除する

    git stash drop stash@{n}
    
  9. すべてのスタッシュを削除する

    git stash clear
    

オプションとフラグ

  1. 変更を一時保存するときにメッセージを付ける

    git stash save "your message here"
    
  2. 変更を一時保存するときに、未追加の変更も含める

    git stash -u
    
  3. 変更を一時保存するときに、未追加の変更と無視されたファイルも含める

    git stash -a
    
0
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
0
0