From 7c1c59c2c11d329ebfec230431970c1e5e79fb47 Mon Sep 17 00:00:00 2001 From: Yu Dou Date: Sat, 17 Dec 2022 16:33:38 +0800 Subject: [PATCH] git-stash: add option show (#9571) * git-stash: add command git stash show * Join two examples --- pages/common/git-stash.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pages/common/git-stash.md b/pages/common/git-stash.md index 0ba7bcbd2..66ecb7f30 100644 --- a/pages/common/git-stash.md +++ b/pages/common/git-stash.md @@ -5,7 +5,7 @@ - Stash current changes, except new (untracked) files: -`git stash [push -m {{optional_stash_message}}]` +`git stash push -m {{optional_stash_message}}` - Stash current changes, including new (untracked) files: @@ -19,18 +19,18 @@ `git stash list` +- Show the changes as a patch between the stash (default is stash@{0}) and the commit back when stash entry was first created: + +`git stash show -p {{stash@{0}}}` + - Apply a stash (default is the latest, named stash@{0}): `git stash apply {{optional_stash_name_or_commit}}` -- Apply a stash (default is stash@{0}), and remove it from the stash list if applying doesn't cause conflicts: +- Drop or 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}}` -- Drop a stash (default is stash@{0}): - -`git stash drop {{optional_stash_name}}` - - Drop all stashes: `git stash clear`