- Published on
Git Stash
- Authors
- Name
- Gene Zhang
git stash temporarily shelves (or stashes) changes you've made to your working copy so you can work on something else, and then come back and re-apply them later on.
Stash
Stash all changes:
git stash
Stash one file:
git stash push -m "Stash myfile" -- myfile.txt
The --
separator is used when:
- Disambiguating between a file and a branch name (if a file has the same name as a branch).
- Ensuring arguments are interpreted as filenames rather than options.
List
git stash list
Apply
git stash pop
or
git stash apply
git stash apply stash@{1}