Skip to content

Commit 525bf29

Browse files
authored
Merge pull request git-tips#141 from dmlemos/stash_additions
Stash additions
2 parents eea471c + 8ccd6fb commit 525bf29

File tree

1 file changed

+40
-1
lines changed

1 file changed

+40
-1
lines changed

README.md

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,10 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`.
4949
* [Find out branches containing commit-hash](#find-out-branches-containing-commit-hash)
5050
* [Git Aliases](#git-aliases)
5151
* [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)
5253
* [Saving current state including untracked files](#saving-current-state-including-untracked-files)
5354
* [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)
5456
* [Show list of all saved stashes](#show-list-of-all-saved-stashes)
5557
* [Apply any stash without deleting from the stashed list](#apply-any-stash-without-deleting-from-the-stashed-list)
5658
* [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:__
406408
git stash save
407409
```
408410

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+
409427
## Saving current state including untracked files
410428
```sh
411-
git stash save -u
429+
git stash -u
412430
```
413431

414432

415433
__Alternatives:__
434+
```sh
435+
git stash save -u
436+
```
437+
438+
416439
```sh
417440
git stash save --include-untracked
418441
```
@@ -422,6 +445,22 @@ git stash save --include-untracked
422445
git stash save <message>
423446
```
424447

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+
425464
## Show list of all saved stashes
426465
```sh
427466
git stash list

0 commit comments

Comments
 (0)