gitatlassian-sourcetreegit-stash

How can I copy the Sourcetree stashes from old PC to a new one?


I built a new PC and I'd like to know if there's a way to copy all the stashes from Sourcetree on my old PC to the Sourcetree on the new PC.

I copied the whole Atlassian folder from C:\Users<username>\AppData\Local\ and pasted it in the same directory on the new PC. After installing Sourcetree under Local repositories it showed me all the repositories I had opened on the old PC with the info "Repository Moved or Deleted".

I cloned the same remote repo to the new PC and it doesn't show any of the stashes that I had. I also clicked on the Moved or Deleted repo, clicked "Change Folder" and pointed to the directory of that repo hoping that it'd maybe then recognize the stashes but they still don't appear there.

One more thing is that I'm using the newest version of Sourcetree which is 3.4.16, I think I had an older one on the old PC (3.4.12 or so). Could this be a reason that the stashes are not properly associated with that repo or is it something entirely different?

Thanks for help!


Solution

  • Stashes are part of your local only history, contained inside the .git folder, so you have to copy your project working folder in order to have the stashes replicated onto the new PC.

    Stashes have nothing to deal with SourceTree or any other GIT client you use.