summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5be6007)
raw | patch | inline | side by side (parent: 5be6007)
author | Junio C Hamano <gitster@pobox.com> | |
Tue, 3 Jul 2007 06:15:45 +0000 (23:15 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 3 Jul 2007 06:15:45 +0000 (23:15 -0700) |
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-stash.txt | patch | blob | history | |
git-stash.sh | patch | blob | history |
index b7d263d6501d023ab1fff6016de5c0a4ed8dd80c..35888b43c8f4a8a4d317f5e8b2c3da8e603e9e9b 100644 (file)
DESCRIPTION
-----------
-Use 'git-stash save' 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.
`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
-list`.
+save`.
The latest stash you created is stored in `$GIT_DIR/refs/stash`; older
stashes are found in the reflog of this reference and can be named using
save::
Save your local modifications to a new 'stash', and run `git-reset
- --hard` to revert them.
+ --hard` to revert them. This is the default action when no
+ subcommand is given.
list::
diff --git a/git-stash.sh b/git-stash.sh
index 777d1e13515960e20e50efa8eeb05289b8d225fb..16979ab41f1f4b4a9276ac9f318e3885f5c6d2a5 100755 (executable)
--- a/git-stash.sh
+++ b/git-stash.sh
# Main command set
case "$1" in
-list | '')
- test $# -gt 0 && shift
+list)
+ shift
if test $# = 0
then
set x -n 10
clear)
clear_stash
;;
-save)
+save | '')
save_stash && git-reset --hard
;;
*)