Skip to content

Instantly share code, notes, and snippets.

Created June 12, 2013 16:35
  • Star 51 You must be signed in to star a gist
  • Fork 9 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Create patch from stash
git stash show -p stash@{0} > Stash0.patch
Copy link

It seams not to add unstaged files. Does it?
Cheers, and thanks for share!

Copy link

3Nigma commented Apr 13, 2022

Thank you, mate!

Copy link


Copy link

xv commented Apr 11, 2023

Won't work from a PowerShell terminal because of the curly braces. The workaround is to wrap stash@{0} in quotes. I.e.,
git stash show -p "stash@{0}" > Stash0.patch


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment