X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=Documentation%2Fgit-stash.txt;h=8728f7a5142284d036594628cbb99da677c16651;hb=6280dfdc3b22aa821521182781e5a247b19fb515;hp=3f14b727b899fbf3b4f7cb6513bd1b14e5938160;hpb=ad336054068074ed614d0bb54bb169e5263499d7;p=git.git diff --git a/Documentation/git-stash.txt b/Documentation/git-stash.txt index 3f14b727b..8728f7a51 100644 --- a/Documentation/git-stash.txt +++ b/Documentation/git-stash.txt @@ -20,7 +20,7 @@ SYNOPSIS 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. @@ -33,7 +33,7 @@ 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. -The latest stash you created is stored in `$GIT_DIR/refs/stash`; older +The latest stash you created is stored in `refs/stash`; older stashes are found in the reflog of this reference and can be named using the usual reflog syntax (e.g. `stash@\{0}` is the most recently created stash, `stash@\{1}` is the one before it, `stash@\{2.hours.ago}` @@ -77,7 +77,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 []:: @@ -85,7 +85,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). pop [--index] [-q|--quiet] []:: @@ -104,18 +104,22 @@ 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). + -When no `` is given, `stash@\{0}` is assumed. +When no `` is given, `stash@\{0}` is assumed, otherwise `` must +be a reference of the form `stash@\{}`. apply [--index] [-q|--quiet] []:: - Like `pop`, but do not remove the state from the stash list. + Like `pop`, but do not remove the state from the stash list. Unlike `pop`, + `` may be any commit that looks like a commit created by + `stash save` or `stash create`. 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 `` + changes recorded in `` to the new working tree and index. + If that succeeds, and `` is a reference of the form + `stash@{}`, it then drops the ``. When no `` is given, applies the latest one. + This is useful if the branch on which you ran `git stash save` has @@ -132,7 +136,9 @@ clear:: drop [-q|--quiet] []:: Remove a single stashed state from the stash list. When no `` - is given, it removes the latest one. i.e. `stash@\{0}` + is given, it removes the latest one. i.e. `stash@\{0}`, otherwise + `` must a valid stash log reference of the form + `stash@\{}`. create:: @@ -201,7 +207,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 ...