GitCheatSheet.org logo
Home / How To

Push files to stash

# Stash local modifications
git stash push -m "My Stash Message"

# Include untracked files
git stash push -u -m "Including untracked files"

# Stash only specified files
git stash push -u -m "Stashing specific files" -- file1.txt file2.txt

Moves the local modifications into a new stash entry. Using "-u" includes untracked files. The message provided with "-m" is optional.