Skip to content

Instantly share code, notes, and snippets.

@jioo
Last active March 13, 2024 14:59
Show Gist options
  • Star 43 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jioo/eebe4c39d800baf99c0db703ded4842c to your computer and use it in GitHub Desktop.
Save jioo/eebe4c39d800baf99c0db703ded4842c to your computer and use it in GitHub Desktop.
How to export stash as a file, and apply it to another computer

Stash current changes

  • git > Stash > Stash (Include Untracked)

Create stash as patch

git stash show "stash@{0}" -p > changes.patch

Apply patch

git apply changes.patch
@LouDnl
Copy link

LouDnl commented Aug 17, 2023

@ ryanesrapado

git config stash.showIncludeUntracked true

https://git-scm.com/docs/git-stash#_configuration

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