git: move stash to repository in another directory

Issue

I have a local stash on a directory.

For some reasons, I had to re-import the same remote project into another directory.

Is there a way to move my stash from my old directory to the new created one since they follow the same remote project and branches ?

Solution

You should be able to copy the .git directory from the old repo over the new one. Git stores every object in files within that directory so that should return your stash.

Answered By – BookOfGreg

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published