Skip to content

Commit 4eaaa42

Browse files
author
Diogo Lemos
committed
Add stash of unstaged changes to tracked files
1 parent eea471c commit 4eaaa42

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ 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)
5455
* [Show list of all saved stashes](#show-list-of-all-saved-stashes)
@@ -406,6 +407,22 @@ __Alternatives:__
406407
git stash save
407408
```
408409

410+
## Saving current state of unstaged changes to tracked files
411+
```sh
412+
git stash -k
413+
```
414+
415+
416+
__Alternatives:__
417+
```sh
418+
git stash --keep-index
419+
```
420+
421+
422+
```sh
423+
git stash save --keep-index
424+
```
425+
409426
## Saving current state including untracked files
410427
```sh
411428
git stash save -u

0 commit comments

Comments
 (0)