I need a way to export a stashed change to another computer.
On computer 1 I did
$ git stash save feature
I\'m trying to get the stash
You can apply a patch file (without committing the changes yet) by simply running
git apply patchfile
Then you can simply create a new stash from the current working directory:
git stash
Apply your stash to it and make a commit
Click on your commit and make a patch from it, take the patch file with you.
Go to a different repository, select the same parent branch which you just used in 1)
Actions / Apply Patch, select Mode: Modify working copy files, push Apply Patch now you have uncommitted modifications from the patch in your current working environment
Make a new Stash for the current repo
The startup command from the original post:
git stash show -p stash@{x} > patch_file
didn't work for me (for some reason it created unusable patch files). Instead I had to:
git stash apply stash@{x}
git commit
for each stash I wanted to transfer. Then, I placed the 'parent' repo within file:/// reach of the 'child' repo, and did the following, for each stash commit:
git fetch file:///path_to_parent_git && git cherry-pick commit_sha
git reset --soft HEAD^
git stash save my_new_stash_on_child
This is more complex but did the trick for me.