1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2024-11-02 01:18:00 +01:00
tldr/pages/common/git-stash.md

28 lines
473 B
Markdown
Raw Normal View History

2013-12-09 12:12:24 +01:00
# git stash
> Stash local Git changes in a temporary area.
2013-12-09 12:12:24 +01:00
- Stash current changes (except new files):
2013-12-09 12:12:24 +01:00
`git stash save {{optional_stash_name}}`
2013-12-09 12:12:24 +01:00
- Include new files in the stash (leaves the index completely clean):
2013-12-09 12:12:24 +01:00
`git stash save -u {{optional_stash_name}}`
2013-12-09 12:12:24 +01:00
- List all stashes:
2013-12-09 12:12:24 +01:00
`git stash list`
- Re-apply the latest stash:
2013-12-09 12:12:24 +01:00
`git stash pop`
- Re-apply a stash by name:
2013-12-09 12:12:24 +01:00
`git stash apply {{stash_name}}`
2014-05-24 22:05:35 +02:00
- Drop a stash by an index:
2014-05-24 22:05:35 +02:00
`git stash drop stash@{index}`