Skip to content

Instantly share code, notes, and snippets.

@ramesaliyev
Created June 15, 2024 12:09
Show Gist options
  • Save ramesaliyev/0bc1dda293dc6a5326b4cbd0d6511938 to your computer and use it in GitHub Desktop.
Save ramesaliyev/0bc1dda293dc6a5326b4cbd0d6511938 to your computer and use it in GitHub Desktop.
Git Stash Pull/Push with Names

To create a stash with a specific name, use:

git stash push -m "your-stash-name"

To view a list of all your stashes, including their names:

git stash list

To apply and remove a specific stash by its name, first, find the stash index using git stash list.
Once you have the index (e.g., stash@{2}), you can pop it:

git stash pop stash@{2}

If you want to apply the stash without removing it, use:

git stash apply stash@{2}

To delete a specific stash by its name:

git stash drop stash@{2}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment