0

I would like to sym link to the directory containing the stashed files.

If there are multiple stash items in the stash list of the local repository then I would like to zip them all from a sym link.

Stephane
  • 11,836
  • 25
  • 112
  • 175
  • `stashed files` that may be a problem. Stashes are stored as commits which generally looks like a diff patch instead of a bunch of files – slebetman Jun 08 '17 at 05:04
  • So they are stored as commits, but are not showed by the `git status` nor `git log` commands ? – Stephane Jun 08 '17 at 05:06
  • 1
    What I meant was that their structure is the same as a commit. I didn't mean they were stored in the same log. The reason for using the same structure is because when you pop a stash all the merge management code must also work on the stashed commit like they do with real commits you pull from remote – slebetman Jun 08 '17 at 05:08
  • 1
    If you want to ship the patches, this may help https://stackoverflow.com/questions/5159185/create-a-git-patch-from-the-changes-in-the-current-working-directory – Mayur Nagekar Jun 08 '17 at 05:16

1 Answers1

1

The stash is actually stored as a commit sha and can be viewed in

./logs/refs/stash
./refs/stash

Then you could git show the commit sha or append --name-status to it to view the list of files in stash.

Mayur Nagekar
  • 813
  • 5
  • 13
  • I only have this file `less ./.git/refs/stash` and it only contains a sha. Where is the actual content then ? – Stephane Jun 08 '17 at 05:04
  • Its stored as a blob. You could git show to see the actual content – Mayur Nagekar Jun 08 '17 at 05:05
  • A blob is a binay large object. I'm not sure that is the case with stash content. – Stephane Jun 08 '17 at 05:08
  • 1
    Since a stash is stored as a commit sha itself, its likely to be stored the same way as any other commit. https://git-scm.com/book/en/v2/Git-Internals-Git-Objects – Mayur Nagekar Jun 08 '17 at 05:12
  • 2
    A stash is in fact at least *two*, and sometimes three, commits. See, e.g., https://stackoverflow.com/q/20586009/1256452 for details. – torek Jun 08 '17 at 05:53