@matheusbsbs / matheus-bagliano / commits / 7a7cc594ca
Fork 0

user-manual: mention git stash

Mention the git-stash command as a way to temporarily set aside work in progress. Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>

Junio C Hamano committed Aug 3, 2007 at 15:22 UTC 7a7cc594ca294a58b6d7ae5aa50a65378538e875
1 file changed +32
Documentation/user-manual.txt
+32
@@ -1484,6 +1484,38 @@ $ git show HEAD^:path/to/file
1484
1485 which will display the given version of the file.
1486
1487 +[[interrupted-work]]
1488 +Temporarily setting aside work in progress
1489 +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1490 +
1491 +While you are in the middle of working on something complicated, you
1492 +find an unrelated but obvious and trivial bug. You would like to fix it
1493 +before continuing. You can use gitlink:git-stash[1] to save the current
1494 +state of your work, and after fixing the bug (or, optionally after doing
1495 +so on a different branch and then coming back), unstash the
1496 +work-in-progress changes.
1497 +
1498 +------------------------------------------------
1499 +$ git stash "work in progress for foo feature"
1500 +------------------------------------------------
1501 +
1502 +This command will save your changes away to the `stash`, and
1503 +reset your working tree and the index to match the tip of your
1504 +current branch. Then you can make your fix as usual.
1505 +
1506 +------------------------------------------------
1507 +... edit and test ...
1508 +$ git commit -a -m "blorpl: typofix"
1509 +------------------------------------------------
1510 +
1511 +After that, you can go back to what you were working on with
1512 +`git stash apply`:
1513 +
1514 +------------------------------------------------
1515 +$ git stash apply
1516 +------------------------------------------------
1517 +
1518 +
1519 [[ensuring-good-performance]]
1520 Ensuring good performance
1521 -------------------------