Last active
June 4, 2025 07:49
-
-
Save enis-ismail/6433cab9dec26d1b7e1dcb6569a2bb63 to your computer and use it in GitHub Desktop.
Move stashes to another PC
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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