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