@@ -49,8 +49,10 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`.
49
49
* [ Find out branches containing commit-hash] ( #find-out-branches-containing-commit-hash )
50
50
* [ Git Aliases] ( #git-aliases )
51
51
* [ Saving current state of tracked files without commiting] ( #saving-current-state-of-tracked-files-without-commiting )
52
+ * [ Saving current state of unstaged changes to tracked files] ( #saving-current-state-of-unstaged-changes-to-tracked-files )
52
53
* [ Saving current state including untracked files] ( #saving-current-state-including-untracked-files )
53
54
* [ Saving current state with message] ( #saving-current-state-with-message )
55
+ * [ Saving current state of all files (ignored, untracked, and tracked)] ( #saving-current-state-of-all-files-ignored-untracked-and-tracked )
54
56
* [ Show list of all saved stashes] ( #show-list-of-all-saved-stashes )
55
57
* [ Apply any stash without deleting from the stashed list] ( #apply-any-stash-without-deleting-from-the-stashed-list )
56
58
* [ Apply last stashed state and delete it from stashed list] ( #apply-last-stashed-state-and-delete-it-from-stashed-list )
@@ -406,13 +408,34 @@ __Alternatives:__
406
408
git stash save
407
409
```
408
410
411
+ ## Saving current state of unstaged changes to tracked files
412
+ ``` sh
413
+ git stash -k
414
+ ```
415
+
416
+
417
+ __ Alternatives:__
418
+ ``` sh
419
+ git stash --keep-index
420
+ ```
421
+
422
+
423
+ ``` sh
424
+ git stash save --keep-index
425
+ ```
426
+
409
427
## Saving current state including untracked files
410
428
``` sh
411
- git stash save -u
429
+ git stash -u
412
430
```
413
431
414
432
415
433
__ Alternatives:__
434
+ ``` sh
435
+ git stash save -u
436
+ ```
437
+
438
+
416
439
``` sh
417
440
git stash save --include-untracked
418
441
```
@@ -422,6 +445,22 @@ git stash save --include-untracked
422
445
git stash save < message>
423
446
```
424
447
448
+ ## Saving current state of all files (ignored, untracked, and tracked)
449
+ ``` sh
450
+ git stash -a
451
+ ```
452
+
453
+
454
+ __ Alternatives:__
455
+ ``` sh
456
+ git stash --all
457
+ ```
458
+
459
+
460
+ ``` sh
461
+ git stash save --all
462
+ ```
463
+
425
464
## Show list of all saved stashes
426
465
``` sh
427
466
git stash list
0 commit comments