DEV Community

harleybl
harleybl

Posted on

1 1

Diff GIT stash versus working directory in Visual Studio 2019

Have you previously stashed some code using git stash and want to see what applying it would do to your workspace?

I had this happen today and my first thought was to reach for "git stash show -p" on the command line. While this is a useful command for a small stash it is not that easy to see the changes in a pretty side by side manner.

The project I am working on is a C# project and I am already using Visual Studio 2019 for the project so I was wondering if there was a way that the tool could help me. Sure enough, the Visual Studio team has already thought of this.

To view a stash within Visual Studio, follow these steps:

  1. Open the Team Explorer
  2. Go to the Changes View within Team Explorer.
  3. Double click on the Stash in the stashes section (below Changes)

This will open up the stash details and allow you to see the files contained in the stash. To see the differences of a specific file in the stash, double click that file to see the difference between the stash and your workspace.

I found this useful, hopefully others will find it useful as well.

AWS GenAI LIVE image

Real challenges. Real solutions. Real talk.

From technical discussions to philosophical debates, AWS and AWS Partners examine the impact and evolution of gen AI.

Learn more

Top comments (0)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay