Teoman shipahi Teoman shipahi - 2 months ago 11
Git Question

Save stashed files into another folder

I have 5 files (mostly .config files) has been stashed from Branch A.
Now, I switched to Branch B. Before I apply stash from A to B, I would like to export as separate files, and browse them with a text editor.

Is it possible to export stashed files into another directory?


One option here at your disposal is git stash branch, which creates, and then checks out, a new branch starting from the commit at the stash:

git stash branch tempbranch

From the branch tempbranch you can copy whatever files you want. When you are finished with the branch, simply delete it and you are done.