added section for git stash

This commit is contained in:
scbj
2025-01-23 17:14:19 +01:00
parent 25c2c4e9c1
commit e0a934821e

8
git.md
View File

@@ -7,6 +7,7 @@
- [branches](#branches)
- [create a branch](#create-a-branch)
- [submodules](#submodules)
- [stash](#stash)
- [removing files from index](#removing-files-from-index)
- [philosophies](#philosophies)
- [merge](#merge)
@@ -53,6 +54,13 @@ git submodule update --init --recursive
```
## stash
If the current tree is dirty, one can use `git stash` to temporarily save the changes and reset the tree to the last commit.
Afterwards the changes can be reapplied with `git stash pop`.
This can be useful if for example one would like to create a new branch for the current changes.
## removing files from index
To remove files from index without deleting them on disk, use: