diff --git a/README.md b/README.md index 9698dc8..b18919d 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,7 @@ smart people at [Hashrocket](http://hashrocket.com/). - [List Untracked Files](git/list-untracked-files.md) - [Single Key Presses in Interactive Mode](git/single-key-presses-in-interactive-mode.md) - [Staging Changes Within Vim](git/staging-changes-within-vim.md) +- [Staging Stashes Interactively](git/staging-stashes-interactively.md) - [Stashing Untracked Files](git/stashing-untracked-files.md) - [Verbose Commit Message](git/verbose-commit-message.md) diff --git a/git/staging-stashes-interactively.md b/git/staging-stashes-interactively.md new file mode 100644 index 0000000..c25368f --- /dev/null +++ b/git/staging-stashes-interactively.md @@ -0,0 +1,14 @@ +# Staging Stashes Interactively + +The `-p` flag can be used with `git stash`, just as it is used with `git add`, +for interactively staging a stash. + +So, if you have changes in your working tree that you want to stash mixed +with ones that you want to keep working with, then you can simply do: + +``` +git stash -p +``` + +Read more on [interactive +staging](https://git-scm.com/book/en/v2/Git-Tools-Interactive-Staging).