Patricia Sauer - Authentic Programming

How to stash a directory or file | The Git Stash Command

Assorted-color thread lot

Stashing means saving your local changes away. Your working directory will be reverted to match the HEAD commit. It might be that you want to stash the changes of your whole working directory (aka everything) or that you want to stash a directory.

How to stash your whole working directory

In Git you can stash the changes of your whole working directory by using the Git stash command:

git stash

How to stash a directory or file

In case that you want to stash the changes of a specific directory or file, you can use the following Git stash command:

git stash push -- path/to/folder/or/file

Reference

For full reference see Git stash documentation.

Liked this article?

Buy Me A Coffee

© 2018 - 2024 Patricia Sauer