Skip to content

Instantly share code, notes, and snippets.

@rais38
Created June 12, 2013 16:35
Show Gist options
  • Save rais38/5766980 to your computer and use it in GitHub Desktop.
Save rais38/5766980 to your computer and use it in GitHub Desktop.
Create patch from stash
git stash show -p stash@{0} > Stash0.patch
@henryfung3a27
Copy link

And to apply the patch, git apply path/to/Stash0.patch

@dmol5E
Copy link

dmol5E commented Jul 30, 2024

If you have new files (untracked) in stash it won't print these files to patch.
To fix it add flag -u
git stash show -u -p stash@{0} > Stash0.patch

@iamtalhaasghar
Copy link

wonderful!

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