Skip to content

Stash changes in a git repository with VS Code

Updated:

2 min read

git stash is a useful command that temporarily stores current changes in a Git repository without committing them, making it possible to return to them later.

Stash using VS Code

Visual Studio Code (VS Code) is a highly capable code editor that offers many well-thought-out functionalities. Even after using it for years, I still find new things about it.

Using in-built Source Control, you can quickly view the modified files and temporarily save them by stashing them:

Stashing changes locally using VS Code

Bring the latest stashed changes to a branch

Let’s assume you’ve now created a new branch where you want to bring those changes that are saved temporarily.

Stashing changes locally using VS Code

You can now bring those changes to the current branch and commit them.

Conclusion

Stashing is particularly useful when you want to fix something and keep those changes around so you can return to them later. Collecting the stashed changes can result in a new branch, where local changes can be brought later.


Previous Post
Change cursor color in VS Code to use a linear gradient
Next Post
2023 - A year in review

I'm a software developer and technical writer. On this blog, I share my learnings about both fields. Recently, I have begun exploring other topics, so don't be surprised if you find something new here.

Currently, working as a documentation lead at Expo.