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 patch to a file and then import it to another computer
$ git stash show -p > patch
This command gives me a file that I can move to another computer where this repo is cloned, but the question is how to import it as a stash again.
You can create stash as patch file from one machine,then can share that patch file to another machines. The “stash@{0}” is the ref of the stash.It will create patch file with latest stash. If you want different one use command $ git stash list to see your list of stashes and select which one you want to patch.
All are stored in . git/refs/stash . git stash saves stashes indefinitely, and all of them are listed by git stash list . Please note that dropping or clearing the stash will remove it from the stash list, but you might still have unpruned nodes with the right data lying around.
Go to Source Control tab. Check the STASHES section. You will find all your stashes (same like git stash list ) You will find direct buttons to Apply Stash, Compare with HEAD and Delete Stash respectively for each stash.
It will make: a new branch (starting from the commit at which the stash was originally created) move changes to this branch. and remove latest stash (Like: git stash pop)
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With