From 57fd36ec387ee8482a45506e340b78152043ef84 Mon Sep 17 00:00:00 2001 From: Eric Nielsen Date: Tue, 30 Aug 2016 17:57:40 -0500 Subject: [PATCH 1/3] git-stash: Make examples clearer - Difference between a stash name and a stash message was not clear. For example, you cannot do: $ git stash save foo $ git stash apply foo fatal: ambiguous argument 'foo': unknown revision or path not in the working tree. - Difference between stash `apply` and `pop` was not clear - Make it clearer that all `apply`, `pop` and `drop` can take an optional stash name, and that the default name is `stash@{0}` --- pages/common/git-stash.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pages/common/git-stash.md b/pages/common/git-stash.md index 4c5919891b..aee89cd9bf 100644 --- a/pages/common/git-stash.md +++ b/pages/common/git-stash.md @@ -4,24 +4,24 @@ - Stash current changes (except new files): -`git stash save {{optional_stash_name}}` +`git stash save {{optional_stash_message}}` - Include new files in the stash (leaves the index completely clean): -`git stash save -u {{optional_stash_name}}` +`git stash save -u {{optional_stash_message}}` - List all stashes: `git stash list` -- Re-apply the latest stash: +- Apply a stash (default is the latest, named stash@{0}): -`git stash pop` +`git stash apply {{optional_stash_name_or_commit}}` -- Re-apply a stash by name: +- Apply a stash (default is stash@{0}), and remove it from the list if applying doesn't cause conflicts: -`git stash apply {{stash_name}}` +`git stash pop {{optional_stash_name}}` -- Drop a stash by an index: +- Drop a stash (default is stash@{0}): -`git stash drop stash@{index}` +`git stash drop {{optional_stash_name}}` From 480255d59581842861f9485eeed95b44ec49c019 Mon Sep 17 00:00:00 2001 From: Eric Nielsen Date: Thu, 1 Sep 2016 13:01:07 -0500 Subject: [PATCH 2/3] git-stash: Improved examples verbosity --- pages/common/git-stash.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pages/common/git-stash.md b/pages/common/git-stash.md index aee89cd9bf..3f5e527180 100644 --- a/pages/common/git-stash.md +++ b/pages/common/git-stash.md @@ -2,15 +2,15 @@ > Stash local Git changes in a temporary area. -- Stash current changes (except new files): +- Stash current changes, except new files: -`git stash save {{optional_stash_message}}` +`git stash [save {{optional_stash_message}}]` -- Include new files in the stash (leaves the index completely clean): +- Stash current changes, including new/untracked files: -`git stash save -u {{optional_stash_message}}` +`git stash -u` -- List all stashes: +- List all stashes (shows stash name, related branch and message): `git stash list` From 2aca1c08b8497951315d68e983b14273ab361865 Mon Sep 17 00:00:00 2001 From: Eric Nielsen Date: Fri, 2 Sep 2016 07:33:17 -0500 Subject: [PATCH 3/3] git-stash: Further improve verbosity of examples --- pages/common/git-stash.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pages/common/git-stash.md b/pages/common/git-stash.md index 3f5e527180..11decd3fa0 100644 --- a/pages/common/git-stash.md +++ b/pages/common/git-stash.md @@ -2,11 +2,11 @@ > Stash local Git changes in a temporary area. -- Stash current changes, except new files: +- Stash current changes, except new (untracked) files: `git stash [save {{optional_stash_message}}]` -- Stash current changes, including new/untracked files: +- Stash current changes, including new (untracked) files: `git stash -u` @@ -18,7 +18,7 @@ `git stash apply {{optional_stash_name_or_commit}}` -- Apply a stash (default is stash@{0}), and remove it from the list if applying doesn't cause conflicts: +- Apply a stash (default is stash@{0}), and remove it from the stash list if applying doesn't cause conflicts: `git stash pop {{optional_stash_name}}`