Add stash snippets

This commit is contained in:
Chalarangelo
2021-04-13 19:36:57 +03:00
parent ee52eda14c
commit f589fe0fd0
6 changed files with 107 additions and 0 deletions

25
snippets/save-stash.md Normal file
View File

@ -0,0 +1,25 @@
---
title: Create a stash
tags: stash,repository,intermediate
---
Saves the current state of the working directory and index into a new stash.
- Use `git stash save` to save the current state of the working directory and index into a new stash.
- You can optionally use the `-u` option to include untracked files.
- You can optionally provide a `<message>` for the stash.
```sh
git stash save [-u] [<message>]
```
```sh
git stash save
# Creates a new stash
git stash save -u
# Creates a new stash, including untracked files
git stash save "Bugfix WIP"
# Creates a new stash with the message "Bugfix WIP"
```