Skip to content

Instantly share code, notes, and snippets.

@alexeds
Created September 5, 2012 18:00
Show Gist options
  • Save alexeds/3641372 to your computer and use it in GitHub Desktop.
Save alexeds/3641372 to your computer and use it in GitHub Desktop.
Move your stashes from one repo to another

Move your stashes from one repo to another


This was useful for me when we created a new branch for a new major release, but were still working on our current version as well. I cloned our repo again and kept the new project on our new branch, but also wanted to get my stashes there.

Download your stashes

git stash show -p > patch

You'll have to specify your stash and name your file whatevery you want. Do this for as all your stashes, and you'll have patch files in your pwd.

Apply your stashes

cd /new/project/dir
git apply /old/project/dir/patchfile
git stash
@coroa
Copy link

coroa commented Feb 23, 2024

@andredsp Glad it was of help! Thanks for the hint! Fixing it above.

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