Where are Git Stamps Saved?

I use PhpStorm and recently hid loading my changes. At some point after this, my PC profile became corrupt and had to be rebuilt.

Now that I have a new PC profile, PhpStorm does not show my hidden changes.

Is there any way to get them back?

+5
source share
3 answers

In documents, the latter is stored in ./.git/refs/stash , while older ones are reflog in the reflog this ref .

As an aside, I have found bad practice to maintain regular use of git stash. As a rule, prefer a lot of small commits to feature branches. Thus, you rarely have to get stuck, and when you do this very little, as such. I usually get stuck only when I need to touch something for a few minutes, and then apply when I still look at something.

https://git-scm.com/docs/git-stash

+8
source

The actual data hidden by the "git stash" symbol (ie the current version of the working tree and the contents of .git / index) is stored as two commit trees.

One compilation tree contains a snapshot of the current state of the working tree. There are some complex snippets here, see below.

Another compilation tree, I was told, is used to store a snapshot of the contents of .git / index during saving. I have not looked deep into it (yet) deep enough to understand how it translates into another.

.git / refs / stash contains a hash value for the commit tree created by the application.

.git / logs / refs / stash contains a reflog-like piece of metadata about entries before that located in .git / refs / stash.

.git / index contains a list of entries, one for each of the files in the working tree. These entries contain the full path and file name, as well as cached file metadata, file system metadata, and git metadata.

"git add" both adds a copy of the file to the object store and sets the setting flag for this file in .git / index.

For "git stash" to create a commit tree, files that have been modified (edited) but not yet delivered with "git add" must be added to the object store. "git stash" does this by creating a temporary index file.

+3
source

All are stored in .git/refs/stash . git stash keeps caches unlimited, and they are all listed by git stash list .

Note that removing or cleaning the cabinet will remove it from the list, but you can still have unmanaged nodes with the right data.

+1
source

Source: https://habr.com/ru/post/1259899/


All Articles