From 0bdcac5666170547dc7882cc1d39b0481206074b Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Mon, 1 Oct 2007 00:30:27 +0200 Subject: git stash: document apply's --index switch Signed-off-by: Junio C Hamano --- Documentation/git-stash.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'Documentation/git-stash.txt') diff --git a/Documentation/git-stash.txt b/Documentation/git-stash.txt index 05f40cff6c..5723bb06f0 100644 --- a/Documentation/git-stash.txt +++ b/Documentation/git-stash.txt @@ -63,7 +63,7 @@ show []:: it will accept any format known to `git-diff` (e.g., `git-stash show -p stash@\{1}` to view the second most recent stash in patch form). -apply []:: +apply [--index] []:: Restore the changes recorded in the stash on top of the current working tree state. When no `` is given, applies the latest @@ -71,6 +71,11 @@ apply []:: + This operation can fail with conflicts; you need to resolve them by hand in the working tree. ++ +If the `--index` option is used, then tries to reinstate not only the working +tree's changes, but also the index's ones. However, this can fail, when you +have conflicts (which are stored in the index, where you therefore can no +longer apply the changes as they were originally). clear:: Remove all the stashed states. Note that those states will then -- cgit v1.2.3 From 06ada1529ce46e84aaef4e5608c1101c1c7ec73f Mon Sep 17 00:00:00 2001 From: Ralf Wildenhues Date: Tue, 9 Oct 2007 23:00:03 +0200 Subject: Fix some typos, punctuation, missing words, minor markup. Signed-off-by: Lars Hjemli Signed-off-by: Shawn O. Pearce --- Documentation/git-stash.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Documentation/git-stash.txt') diff --git a/Documentation/git-stash.txt b/Documentation/git-stash.txt index 5723bb06f0..c0147b99a2 100644 --- a/Documentation/git-stash.txt +++ b/Documentation/git-stash.txt @@ -57,7 +57,7 @@ stash@{1}: On master: 9cc0589... Add git-stash show []:: - Show the changes recorded in the stash as a diff between the the + Show the changes recorded in the stash as a diff between the stashed state and its original parent. When no `` is given, shows the latest one. By default, the command shows the diffstat, but it will accept any format known to `git-diff` (e.g., `git-stash show -- cgit v1.2.3 From 5162e69732d13dd079919a389a6ace8878aad716 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sat, 29 Dec 2007 00:20:38 -0600 Subject: Documentation: rename gitlink macro to linkgit Between AsciiDoc 8.2.2 and 8.2.3, the following change was made to the stock Asciidoc configuration: @@ -149,7 +153,10 @@ # Inline macros. # Backslash prefix required for escape processing. # (?s) re flag for line spanning. -(?su)[\\]?(?P\w(\w|-)*?):(?P\S*?)(\[(?P.*?)\])= + +# Explicit so they can be nested. +(?su)[\\]?(?P(http|https|ftp|file|mailto|callto|image|link)):(?P\S*?)(\[(?P.*?)\])= + # Anchor: [[[id]]]. Bibliographic anchor. (?su)[\\]?\[\[\[(?P[\w][\w-]*?)\]\]\]=anchor3 # Anchor: [[id,xreflabel]] This default regex now matches explicit values, and unfortunately in this case gitlink was being matched by just 'link', causing the wrong inline macro template to be applied. By renaming the macro, we can avoid being matched by the wrong regex. Signed-off-by: Dan McGee Signed-off-by: Junio C Hamano --- Documentation/git-stash.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'Documentation/git-stash.txt') diff --git a/Documentation/git-stash.txt b/Documentation/git-stash.txt index c0147b99a2..9889806a5e 100644 --- a/Documentation/git-stash.txt +++ b/Documentation/git-stash.txt @@ -156,10 +156,10 @@ $ git stash apply SEE ALSO -------- -gitlink:git-checkout[1], -gitlink:git-commit[1], -gitlink:git-reflog[1], -gitlink:git-reset[1] +linkgit:git-checkout[1], +linkgit:git-commit[1], +linkgit:git-reflog[1], +linkgit:git-reset[1] AUTHOR ------ @@ -167,4 +167,4 @@ Written by Nanako Shiraishi GIT --- -Part of the gitlink:git[7] suite +Part of the linkgit:git[7] suite -- cgit v1.2.3 From 71bda8b923ed1bde7b831c6597af5a80213f6768 Mon Sep 17 00:00:00 2001 From: Jari Aalto Date: Sat, 2 Feb 2008 16:03:48 +0200 Subject: Documentation/git-stash.txt: Adjust SYNOPSIS command syntax (2) Adjust the command syntax to better reflect the call parameters: [save] [message...] => [save []]. Signed-off-by: Jari Aalto Signed-off-by: Junio C Hamano --- Documentation/git-stash.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'Documentation/git-stash.txt') diff --git a/Documentation/git-stash.txt b/Documentation/git-stash.txt index 9889806a5e..cd0dc1bd9d 100644 --- a/Documentation/git-stash.txt +++ b/Documentation/git-stash.txt @@ -9,7 +9,7 @@ SYNOPSIS -------- [verse] 'git-stash' (list | show [] | apply [] | clear) -'git-stash' [save] [message...] +'git-stash' [save []] DESCRIPTION ----------- @@ -36,11 +36,12 @@ is also possible). OPTIONS ------- -save:: +save []:: Save your local modifications to a new 'stash', and run `git-reset --hard` to revert them. This is the default action when no - subcommand is given. + subcommand is given. The part is optional and gives + the description along with the stashed state. list:: -- cgit v1.2.3 From fbd538c262b03d7b096e840a7ef0cdd54c5cea4f Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Wed, 20 Feb 2008 12:31:35 +0100 Subject: Documentation/git-stash: document options for git stash list Signed-off-by: Miklos Vajna Signed-off-by: Junio C Hamano --- Documentation/git-stash.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Documentation/git-stash.txt') diff --git a/Documentation/git-stash.txt b/Documentation/git-stash.txt index cd0dc1bd9d..48e6f5a3f7 100644 --- a/Documentation/git-stash.txt +++ b/Documentation/git-stash.txt @@ -43,7 +43,7 @@ save []:: subcommand is given. The part is optional and gives the description along with the stashed state. -list:: +list []:: List the stashes that you currently have. Each 'stash' is listed with its name (e.g. `stash@\{0}` is the latest stash, `stash@\{1}` is @@ -55,6 +55,9 @@ list:: stash@{0}: WIP on submit: 6ebd0e2... Update git-stash documentation stash@{1}: On master: 9cc0589... Add git-stash ---------------------------------------------------------------- ++ +The command takes options applicable to the linkgit:git-log[1] +command to control what is shown and how. show []:: -- cgit v1.2.3 From e25d5f9c82ef6a676de616bd28751cdfbcd53b15 Mon Sep 17 00:00:00 2001 From: Brandon Casey Date: Fri, 22 Feb 2008 13:04:54 -0600 Subject: git-stash: add new 'drop' subcommand This allows a single stash entry to be deleted. It takes an optional argument which is a stash reflog entry. If no arguments are supplied, it drops the most recent stash entry. Signed-off-by: Brandon Casey Signed-off-by: Junio C Hamano --- Documentation/git-stash.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'Documentation/git-stash.txt') diff --git a/Documentation/git-stash.txt b/Documentation/git-stash.txt index 48e6f5a3f7..f50c24ce9a 100644 --- a/Documentation/git-stash.txt +++ b/Documentation/git-stash.txt @@ -8,7 +8,7 @@ git-stash - Stash the changes in a dirty working directory away SYNOPSIS -------- [verse] -'git-stash' (list | show [] | apply [] | clear) +'git-stash' (list | show [] | apply [] | clear | drop []) 'git-stash' [save []] DESCRIPTION @@ -85,6 +85,11 @@ clear:: Remove all the stashed states. Note that those states will then be subject to pruning, and may be difficult or impossible to recover. +drop []:: + + Remove a single stashed state from the stash list. When no `` + is given, it removes the latest one. i.e. `stash@\{0}` + DISCUSSION ---------- -- cgit v1.2.3 From bd56ff54f710d463a6858bdc7ef6245f9ef30f42 Mon Sep 17 00:00:00 2001 From: Brandon Casey Date: Fri, 22 Feb 2008 16:52:50 -0600 Subject: git-stash: add new 'pop' subcommand This combines the existing stash subcommands 'apply' and 'drop' to allow a single stash entry to be applied and then dropped, in other words 'popped', from the stash list. Signed-off-by: Brandon Casey Signed-off-by: Junio C Hamano --- Documentation/git-stash.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'Documentation/git-stash.txt') diff --git a/Documentation/git-stash.txt b/Documentation/git-stash.txt index f50c24ce9a..8dc35d493e 100644 --- a/Documentation/git-stash.txt +++ b/Documentation/git-stash.txt @@ -8,7 +8,7 @@ git-stash - Stash the changes in a dirty working directory away SYNOPSIS -------- [verse] -'git-stash' (list | show [] | apply [] | clear | drop []) +'git-stash' (list | show [] | apply [] | clear | drop [] | pop []) 'git-stash' [save []] DESCRIPTION @@ -90,6 +90,12 @@ drop []:: Remove a single stashed state from the stash list. When no `` is given, it removes the latest one. i.e. `stash@\{0}` +pop []:: + + Remove a single stashed state from the stash list and apply on top + of the current working tree state. When no `` is given, + `stash@\{0}` is assumed. See also `apply`. + DISCUSSION ---------- -- cgit v1.2.3 From 9e1f0a85c68323830ea117092c55192b17aa3ac8 Mon Sep 17 00:00:00 2001 From: Christian Couder Date: Fri, 6 Jun 2008 09:07:32 +0200 Subject: documentation: move git(7) to git(1) As the "git" man page describes the "git" command at the end-user level, it seems better to move it to man section 1. Signed-off-by: Christian Couder Signed-off-by: Junio C Hamano --- Documentation/git-stash.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Documentation/git-stash.txt') diff --git a/Documentation/git-stash.txt b/Documentation/git-stash.txt index 8dc35d493e..baa4f55b48 100644 --- a/Documentation/git-stash.txt +++ b/Documentation/git-stash.txt @@ -182,4 +182,4 @@ Written by Nanako Shiraishi GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite -- cgit v1.2.3 From b1889c36d85514e5e70462294c561a02c2edfe2b Mon Sep 17 00:00:00 2001 From: Jonathan Nieder Date: Mon, 30 Jun 2008 01:09:04 -0500 Subject: Documentation: be consistent about "git-" versus "git " Since the git-* commands are not installed in $(bindir), using "git-command " in examples in the documentation is not a good idea. On the other hand, it is nice to be able to refer to each command using one hyphenated word. (There is no escaping it, anyway: man page names cannot have spaces in them.) This patch retains the dash in naming an operation, command, program, process, or action. Complete command lines that can be entered at a shell (i.e., without options omitted) are made to use the dashless form. The changes consist only of replacing some spaces with hyphens and vice versa. After a "s/ /-/g", the unpatched and patched versions are identical. Signed-off-by: Jonathan Nieder Signed-off-by: Junio C Hamano --- Documentation/git-stash.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'Documentation/git-stash.txt') diff --git a/Documentation/git-stash.txt b/Documentation/git-stash.txt index baa4f55b48..f994679d95 100644 --- a/Documentation/git-stash.txt +++ b/Documentation/git-stash.txt @@ -8,13 +8,13 @@ git-stash - Stash the changes in a dirty working directory away SYNOPSIS -------- [verse] -'git-stash' (list | show [] | apply [] | clear | drop [] | pop []) -'git-stash' [save []] +'git stash' (list | show [] | apply [] | clear | drop [] | pop []) +'git stash' [save []] DESCRIPTION ----------- -Use 'git-stash' when you want to record the current state of the +Use 'git stash' when you want to record the current state of the working directory and the index, but want to go back to a clean working directory. The command saves your local modifications away and reverts the working directory to match the `HEAD` commit. @@ -22,7 +22,7 @@ and reverts the working directory to match the `HEAD` commit. The modifications stashed away by this command can be listed with `git-stash list`, inspected with `git-stash show`, and restored (potentially on top of a different commit) with `git-stash apply`. -Calling git-stash without any arguments is equivalent to `git-stash +Calling git stash without any arguments is equivalent to `git stash save`. A stash is by default listed as "WIP on 'branchname' ...", but you can give a more descriptive message on the command line when you create one. @@ -38,7 +38,7 @@ OPTIONS save []:: - Save your local modifications to a new 'stash', and run `git-reset + Save your local modifications to a new 'stash', and run `git reset --hard` to revert them. This is the default action when no subcommand is given. The part is optional and gives the description along with the stashed state. @@ -64,7 +64,7 @@ show []:: Show the changes recorded in the stash as a diff between the stashed state and its original parent. When no `` is given, shows the latest one. By default, the command shows the diffstat, but - it will accept any format known to `git-diff` (e.g., `git-stash show + it will accept any format known to `git-diff` (e.g., `git stash show -p stash@\{1}` to view the second most recent stash in patch form). apply [--index] []:: -- cgit v1.2.3 From 483bc4f045881b998512ae814d6cf44d0c0cb493 Mon Sep 17 00:00:00 2001 From: Jonathan Nieder Date: Mon, 30 Jun 2008 13:56:34 -0500 Subject: Documentation formatting and cleanup Following what appears to be the predominant style, format names of commands and commandlines both as `teletype text`. While we're at it, add articles ("a" and "the") in some places, italicize the name of the command in the manual page synopsis line, and add a comma or two where it seems appropriate. Signed-off-by: Jonathan Nieder Signed-off-by: Junio C Hamano --- Documentation/git-stash.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'Documentation/git-stash.txt') diff --git a/Documentation/git-stash.txt b/Documentation/git-stash.txt index f994679d95..23ac331295 100644 --- a/Documentation/git-stash.txt +++ b/Documentation/git-stash.txt @@ -20,10 +20,10 @@ working directory. The command saves your local modifications away and reverts the working directory to match the `HEAD` commit. The modifications stashed away by this command can be listed with -`git-stash list`, inspected with `git-stash show`, and restored -(potentially on top of a different commit) with `git-stash apply`. -Calling git stash without any arguments is equivalent to `git stash -save`. A stash is by default listed as "WIP on 'branchname' ...", but +`git stash list`, inspected with `git stash show`, and restored +(potentially on top of a different commit) with `git stash apply`. +Calling `git stash` without any arguments is equivalent to `git stash save`. +A stash is by default listed as "WIP on 'branchname' ...", but you can give a more descriptive message on the command line when you create one. @@ -56,8 +56,8 @@ stash@{0}: WIP on submit: 6ebd0e2... Update git-stash documentation stash@{1}: On master: 9cc0589... Add git-stash ---------------------------------------------------------------- + -The command takes options applicable to the linkgit:git-log[1] -command to control what is shown and how. +The command takes options applicable to the `git-log` +command to control what is shown and how. See linkgit:git-log[1]. show []:: -- cgit v1.2.3 From 656b50345239293929ad8c639c5f1941c6b867ad Mon Sep 17 00:00:00 2001 From: Abhijit Menon-Sen Date: Thu, 3 Jul 2008 11:46:05 +0530 Subject: Implement "git stash branch " Restores the stashed state on a new branch rooted at the commit on which the stash was originally created, so that conflicts caused by subsequent changes on the original branch can be dealt with. (Thanks to Junio for this nice idea.) Signed-off-by: Abhijit Menon-Sen Signed-off-by: Junio C Hamano --- Documentation/git-stash.txt | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'Documentation/git-stash.txt') diff --git a/Documentation/git-stash.txt b/Documentation/git-stash.txt index 23ac331295..a4cbd0ce60 100644 --- a/Documentation/git-stash.txt +++ b/Documentation/git-stash.txt @@ -8,8 +8,11 @@ git-stash - Stash the changes in a dirty working directory away SYNOPSIS -------- [verse] -'git stash' (list | show [] | apply [] | clear | drop [] | pop []) +'git stash' list +'git stash' (show | apply | drop | pop ) [] +'git stash' branch [] 'git stash' [save []] +'git stash' clear DESCRIPTION ----------- @@ -81,6 +84,20 @@ tree's changes, but also the index's ones. However, this can fail, when you have conflicts (which are stored in the index, where you therefore can no longer apply the changes as they were originally). +branch []:: + + Creates and checks out a new branch named `` starting from + the commit at which the `` was originally created, applies the + changes recorded in `` to the new working tree and index, then + drops the `` if that completes successfully. When no `` + is given, applies the latest one. ++ +This is useful if the branch on which you ran `git stash save` has +changed enough that `git stash apply` fails due to conflicts. Since +the stash is applied on top of the commit that was HEAD at the time +`git stash` was run, it restores the originally stashed state with +no conflicts. + clear:: Remove all the stashed states. Note that those states will then be subject to pruning, and may be difficult or impossible to recover. -- cgit v1.2.3 From 7bedebcaad351108a8f6eab6a031f2be2c06b613 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?SZEDER=20G=C3=A1bor?= Date: Fri, 27 Jun 2008 16:37:15 +0200 Subject: stash: introduce 'stash save --keep-index' option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 'git stash save' saves local modifications to a new stash, and runs 'git reset --hard' to revert them to a clean index and work tree. When the '--keep-index' option is specified, after that 'git reset --hard' the previous contents of the index is restored and the work tree is updated to match the index. This option is useful if the user wants to commit only parts of his local modifications, but wants to test those parts before committing. Also add support for the completion of the new option, and add an example use case to the documentation. Signed-off-by: SZEDER Gábor Signed-off-by: Junio C Hamano --- Documentation/git-stash.txt | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'Documentation/git-stash.txt') diff --git a/Documentation/git-stash.txt b/Documentation/git-stash.txt index 23ac331295..8f331ee7d4 100644 --- a/Documentation/git-stash.txt +++ b/Documentation/git-stash.txt @@ -36,12 +36,15 @@ is also possible). OPTIONS ------- -save []:: +save [--keep-index] []:: Save your local modifications to a new 'stash', and run `git reset --hard` to revert them. This is the default action when no subcommand is given. The part is optional and gives the description along with the stashed state. ++ +If the `--keep-index` option is used, all changes already added to the +index are left intact. list []:: @@ -169,6 +172,23 @@ $ git stash apply ... continue hacking ... ---------------------------------------------------------------- +Testing partial commits:: + +You can use `git stash save --keep-index` when you want to make two or +more commits out of the changes in the work tree, and you want to test +each change before committing: ++ +---------------------------------------------------------------- +... hack hack hack ... +$ git add --patch foo +$ git stash save --keep-index +$ build && run tests +$ git commit -m 'First part' +$ git stash apply +$ build && run tests +$ git commit -a -m 'Second part' +---------------------------------------------------------------- + SEE ALSO -------- linkgit:git-checkout[1], -- cgit v1.2.3 From ba020ef5eb5fca3d757bd580ff117adaf81ca079 Mon Sep 17 00:00:00 2001 From: Jonathan Nieder Date: Thu, 3 Jul 2008 00:41:41 -0500 Subject: manpages: italicize git command names (which were in teletype font) The names of git commands are not meant to be entered at the commandline; they are just names. So we render them in italics, as is usual for command names in manpages. Using doit () { perl -e 'for (<>) { s/\`(git-[^\`.]*)\`/'\''\1'\''/g; print }' } for i in git*.txt config.txt diff*.txt blame*.txt fetch*.txt i18n.txt \ merge*.txt pretty*.txt pull*.txt rev*.txt urls*.txt do doit <"$i" >"$i+" && mv "$i+" "$i" done git diff . Signed-off-by: Jonathan Nieder Signed-off-by: Junio C Hamano --- Documentation/git-stash.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Documentation/git-stash.txt') diff --git a/Documentation/git-stash.txt b/Documentation/git-stash.txt index 23ac331295..9b6b911091 100644 --- a/Documentation/git-stash.txt +++ b/Documentation/git-stash.txt @@ -56,7 +56,7 @@ stash@{0}: WIP on submit: 6ebd0e2... Update git-stash documentation stash@{1}: On master: 9cc0589... Add git-stash ---------------------------------------------------------------- + -The command takes options applicable to the `git-log` +The command takes options applicable to the 'git-log' command to control what is shown and how. See linkgit:git-log[1]. show []:: @@ -64,7 +64,7 @@ show []:: Show the changes recorded in the stash as a diff between the stashed state and its original parent. When no `` is given, shows the latest one. By default, the command shows the diffstat, but - it will accept any format known to `git-diff` (e.g., `git stash show + it will accept any format known to 'git-diff' (e.g., `git stash show -p stash@\{1}` to view the second most recent stash in patch form). apply [--index] []:: @@ -158,7 +158,7 @@ $ git reset --soft HEAD^ ... continue hacking ... ---------------------------------------------------------------- + -You can use `git-stash` to simplify the above, like this: +You can use 'git-stash' to simplify the above, like this: + ---------------------------------------------------------------- ... hack hack hack ... -- cgit v1.2.3 From caf1899699b2255111a3db335553e31f3718c1c9 Mon Sep 17 00:00:00 2001 From: Eric Raible Date: Tue, 8 Jul 2008 00:40:56 -0700 Subject: Documentation: tweak use case in "git stash save --keep-index" The documentation suggests using "git stash apply" in the --keep-index workflow even though doing so will lead to clutter in the stash. And given that the changes are about to be committed anyway "git stash pop" is more sensible. Additionally the text preceeding the example claims that it works for "two or more commits", but the example itself is really tailored for just two. Expanding it just a little makes it clear how the procedure generalizes to N commits. Finally the example is annotated with some commentary to explain things on a line-by-line basis. --- Documentation/git-stash.txt | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'Documentation/git-stash.txt') diff --git a/Documentation/git-stash.txt b/Documentation/git-stash.txt index 8f331ee7d4..e2c8722376 100644 --- a/Documentation/git-stash.txt +++ b/Documentation/git-stash.txt @@ -180,13 +180,14 @@ each change before committing: + ---------------------------------------------------------------- ... hack hack hack ... -$ git add --patch foo -$ git stash save --keep-index -$ build && run tests -$ git commit -m 'First part' -$ git stash apply -$ build && run tests -$ git commit -a -m 'Second part' +$ git add --patch foo # add just first part to the index +$ git stash save --keep-index # save all other changes to the stash +$ edit/build/test first part +$ git commit foo -m 'First part' # commit fully tested change +$ git stash pop # prepare to work on all other changes +... repeat above five steps until one commit remains ... +$ edit/build/test remaining parts +$ git commit foo -m 'Remaining parts' ---------------------------------------------------------------- SEE ALSO -- cgit v1.2.3 From a5ab00c5d20cee04ce181bb5a6c3ca5d923744a4 Mon Sep 17 00:00:00 2001 From: Stephan Beyer Date: Sat, 16 Aug 2008 05:27:31 +0200 Subject: git-stash: improve synopsis in help and manual page "git stash -h" showed some incomplete and ugly usage information. For example, the useful "--keep-index" option for "save" or the "--index" option for "apply" were not shown. Also in the documentation synopsis they were not shown, so that there is no incentive to scroll down and even see that such options exist. This patch improves the git-stash synopsis in the documentation by mentioning that further options to the stash commands and then copies this synopsis to the usage information string of git-stash.sh. For the latter, the dashless git command string has to be inserted on the second and the following usage lines. The code of this is taken from git-sh-setup so that all lines will show the command string. Note that the "create" command is not advertised at all now, because it was not mentioned in git-stash.txt. Signed-off-by: Stephan Beyer Signed-off-by: Junio C Hamano --- Documentation/git-stash.txt | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'Documentation/git-stash.txt') diff --git a/Documentation/git-stash.txt b/Documentation/git-stash.txt index 7d50d74cc9..49e2296a24 100644 --- a/Documentation/git-stash.txt +++ b/Documentation/git-stash.txt @@ -8,11 +8,13 @@ git-stash - Stash the changes in a dirty working directory away SYNOPSIS -------- [verse] -'git stash' list -'git stash' (show | apply | drop | pop ) [] +'git stash' list [] +'git stash' (show | drop | pop ) [] +'git stash' apply [--index] [] 'git stash' branch [] -'git stash' [save []] +'git stash' [save [--keep-index] []] 'git stash' clear +'git stash' create DESCRIPTION ----------- @@ -116,6 +118,11 @@ pop []:: of the current working tree state. When no `` is given, `stash@\{0}` is assumed. See also `apply`. +create:: + + Create a stash (which is a regular commit object) and return its + object name, without storing it anywhere in the ref namespace. + DISCUSSION ---------- -- cgit v1.2.3 From 9da6f0fff2d6ab4bfad36099b53c911bc498fc2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?SZEDER=20G=C3=A1bor?= Date: Tue, 2 Sep 2008 03:35:24 +0200 Subject: Documentation: fix disappeared lines in 'git stash' manpage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Asciidoc removes lines starting with a dot when creating manpages. Since those lines were comments in use case examples showing shell commands, preceed those lines with a hash sign. Signed-off-by: SZEDER Gábor Signed-off-by: Junio C Hamano --- Documentation/git-stash.txt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'Documentation/git-stash.txt') diff --git a/Documentation/git-stash.txt b/Documentation/git-stash.txt index 49e2296a24..e64e1f1244 100644 --- a/Documentation/git-stash.txt +++ b/Documentation/git-stash.txt @@ -159,7 +159,7 @@ perform a pull, and then unstash, like this: + ---------------------------------------------------------------- $ git pull -... + ... file foobar not up to date, cannot merge. $ git stash $ git pull @@ -174,7 +174,7 @@ make a commit to a temporary branch to store your changes away, and return to your original branch to make the emergency fix, like this: + ---------------------------------------------------------------- -... hack hack hack ... +# ... hack hack hack ... $ git checkout -b my_wip $ git commit -a -m "WIP" $ git checkout master @@ -182,18 +182,18 @@ $ edit emergency fix $ git commit -a -m "Fix in a hurry" $ git checkout my_wip $ git reset --soft HEAD^ -... continue hacking ... +# ... continue hacking ... ---------------------------------------------------------------- + You can use 'git-stash' to simplify the above, like this: + ---------------------------------------------------------------- -... hack hack hack ... +# ... hack hack hack ... $ git stash $ edit emergency fix $ git commit -a -m "Fix in a hurry" $ git stash apply -... continue hacking ... +# ... continue hacking ... ---------------------------------------------------------------- Testing partial commits:: @@ -203,13 +203,13 @@ more commits out of the changes in the work tree, and you want to test each change before committing: + ---------------------------------------------------------------- -... hack hack hack ... +# ... hack hack hack ... $ git add --patch foo # add just first part to the index $ git stash save --keep-index # save all other changes to the stash $ edit/build/test first part $ git commit foo -m 'First part' # commit fully tested change $ git stash pop # prepare to work on all other changes -... repeat above five steps until one commit remains ... +# ... repeat above five steps until one commit remains ... $ edit/build/test remaining parts $ git commit foo -m 'Remaining parts' ---------------------------------------------------------------- -- cgit v1.2.3 From f733c70941a79e8d7a05d16fac89294ef0366bda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?SZEDER=20G=C3=A1bor?= Date: Tue, 2 Sep 2008 03:45:01 +0200 Subject: Documentation: minor cleanup in a use case in 'git stash' manual MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There is no need to explicitly pass the file to be committed to 'git commit', because it's contents is already in the index. Signed-off-by: SZEDER Gábor Signed-off-by: Junio C Hamano --- Documentation/git-stash.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Documentation/git-stash.txt') diff --git a/Documentation/git-stash.txt b/Documentation/git-stash.txt index e64e1f1244..051f94d26f 100644 --- a/Documentation/git-stash.txt +++ b/Documentation/git-stash.txt @@ -207,7 +207,7 @@ each change before committing: $ git add --patch foo # add just first part to the index $ git stash save --keep-index # save all other changes to the stash $ edit/build/test first part -$ git commit foo -m 'First part' # commit fully tested change +$ git commit -m 'First part' # commit fully tested change $ git stash pop # prepare to work on all other changes # ... repeat above five steps until one commit remains ... $ edit/build/test remaining parts -- cgit v1.2.3