1

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?

Teoman shipahi
  • 47,454
  • 15
  • 134
  • 158
  • See [here](http://stackoverflow.com/questions/7677736/git-diff-against-a-stash) for different ways to view a stash. – Tim Biegeleisen Oct 17 '16 at 21:13
  • 1
    @TimBiegeleisen looks like he wants to see differences to original file. That I can already do. I want to export entire file with changes applied to it. – Teoman shipahi Oct 17 '16 at 21:15

1 Answers1

1

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.

Tim Biegeleisen
  • 502,043
  • 27
  • 286
  • 360