Skip to content

Instantly share code, notes, and snippets.

@kad1r
Last active November 7, 2023 14:42
Show Gist options
  • Save kad1r/110dd12bb40add90ec1821a009102091 to your computer and use it in GitHub Desktop.
Save kad1r/110dd12bb40add90ec1821a009102091 to your computer and use it in GitHub Desktop.
Git commands

Stash

git stash
git stash save "your_stash_name"
git stash list
// Remove nth stash
git stash pop stash@{n}
// Apply nth stash
git stash apply stash@{n}
// If stash apply give an error like error: unknown switch `e' then use with quote
git stash apply 'stash@{n}'
// Apply stash by name
git stash apply stash^{/your_stash_name}
// Remove all stash items
git stash clear
// Remove given stash
git stash drop stash@{n}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment