Long story short, yes, I really had to google this, and since top results seemed to give pretty obtuse answers, I decided to document it for myself.
And just to state the obvious: I’m using GitHub Desktop for most of my mandatory Git stuff, but for whenever I have to run any git commands, I run Windows PowerShell (git exe is added to PATH variable).
Well, it’s actually very, VERY simple. You can just run something like this:
git stash list
The command outputs a nice list of all stashes you have and which branch they belong to. But what to make of it?
Time needed: 10 minutes.
How to list your Git stashes using PowerShell?
- Open any console application that has git executable configured
Windows PowerShell is my choice, but you can just use Git Bash instead.
- Change the working directory to your project’s root folder
Something along the lines of:
- Run git stash list
That’ll list your stashes on different repositories and branches.
The output will look somewhat like this:
- Investigate the output
The screenshot displays different stashes on different branches.
(Sorry – I actually took the screenshot from production, so I had to blur the branch names.)
- Dig deeper into your stashes
If you want to quickly see what do the stashes actually contain, there’s another command you can do to find it out:
git stash show
This’ll show the contents of the latest stash.
If you want to investigate stashes other than the latest, you can just add the id of the stash as an additional parameter:
git stash show 1
Now that you’ve got a list of your stashes and branches, you should know where to go. :)
- How to configure Azure Function’s startup? - October 21, 2020
- How to list your git stashes? - October 14, 2020
- How to fix “System.InvalidOperationException: PowerShell Gallery is currently unavailable.” - October 5, 2020