Difference between revisions of "Git/stash"
< Git
		
		
		
		Jump to navigation
		Jump to search
		|  (git tools for stashing) |  (commands) | ||
| Line 1: | Line 1: | ||
| '''Action''': saves your local modifications away and reverts the working directory to match the HEAD commit | '''Action''': saves your local modifications away and reverts the working directory to match the HEAD commit | ||
| + | ==Commands== | ||
| + | * <code>git stash apply</code> replaces current files with the most recently stashed files (but does not delete the stash) | ||
| + | * <code>git stash drop</code> deletes the newest stash (i.e. the most recently stashed files) | ||
| + | * <code>git stash list</code> displays existing stashes, for all branches, sorted newest-to-oldest | ||
| ==Links== | ==Links== | ||
| ===Documentation=== | ===Documentation=== | ||
| * [http://kernel.org/pub/software/scm/git/docs/git-stash.html manpage @ kernel.org] | * [http://kernel.org/pub/software/scm/git/docs/git-stash.html manpage @ kernel.org] | ||
| * [https://git-scm.com/book/en/v1/Git-Tools-Stashing 6.3 Git Tools - Stashing] | * [https://git-scm.com/book/en/v1/Git-Tools-Stashing 6.3 Git Tools - Stashing] | ||
Latest revision as of 12:36, 17 November 2018
Action: saves your local modifications away and reverts the working directory to match the HEAD commit
Commands
- git stash applyreplaces current files with the most recently stashed files (but does not delete the stash)
- git stash dropdeletes the newest stash (i.e. the most recently stashed files)
- git stash listdisplays existing stashes, for all branches, sorted newest-to-oldest