Skip to content

Instantly share code, notes, and snippets.

@enis-ismail
Last active June 4, 2025 07:49
Show Gist options
  • Save enis-ismail/6433cab9dec26d1b7e1dcb6569a2bb63 to your computer and use it in GitHub Desktop.
Save enis-ismail/6433cab9dec26d1b7e1dcb6569a2bb63 to your computer and use it in GitHub Desktop.
Move stashes to another PC
# On first PC:
git stash list # See the available stashes and their indexes
git stash show "stash@{X}" -p --binary > stash_ABC.patch # Replace X with the stash index from above
# Transfer the .patch files to the new PC
# On second PC:
cd ../ # CD to the project root, otherwise there's a chance git apply fails silently
git apply -3 ./patches/stash_ABC.patch # Use -3 so we can fix conflicts if any
# Fix conflicts if any, and stash again the applied changes in the new PC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment