]> git.ipfire.org Git - thirdparty/git.git/blobdiff - Documentation/git-stash.txt
Documentation: tweak use case in "git stash save --keep-index"
[thirdparty/git.git] / Documentation / git-stash.txt
index 8f331ee7d41ab5031e7b490e199dad7885e96a1a..e2c87223769a47a271d91720887197765bccbacd 100644 (file)
@@ -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