Gitには、ステージングされていない変更のみを隠蔽するコマンドはありません。
ただし、Gitでは、隠しておくファイルを指定できます。
git stash push --message 'Unstaged changes' -- app/controllers/products_controller.rb test/controllers/products_controller_test.rb
これらのファイルに特定の変更のみを隠したい場合は、--patch
オプションを追加してください。
git stash push --patch --message 'Unstaged changes' -- app/controllers/products_controller.rb test/controllers/products_controller_test.rb
この--include-untracked
オプションを使用すると、追跡されていないファイルを隠しておくことができます。
git stash push --include-untracked --message 'Untracked files' -- app/controllers/widgets_controller.rb test/controllers/widgets_controller_test.rb
git help stash
詳細については、 (または)を実行man git-stash
してください。
注:ステージングされていない変更がかなり非整理化されている場合は、@alesguzikの回答の方がおそらく簡単です。