Git repository recovery

Using PhotoRec to recover lost data
Forum rules
When asking for technical support:
- Search for posts on the same topic before posting a new question.
- Give clear, specific information in the title of your post.
- Include as many details as you can, MOST POSTS WILL GET ONLY ONE OR TWO ANSWERS.
- Post a follow up with a "Thank you" or "This worked!"
- When you learn something, use that knowledge to HELP ANOTHER USER LATER.
Before posting, please read
Posts: 1
Joined: 07 Oct 2012, 18:32

Git repository recovery

#1 Post by ressu »

It would be useful if photorec knew how to recover git repository files. The file format documentation is here: ... format.txt

While restoring the repository from these files is not exactly straightforward, it can be done.

The basic restore can be done with the following in photorec.sig:

Code: Select all

pack 0 "PACK" 0x00000002
idx 0 0xFF "tOc"
The problem is that if I try to make a full restore with only these files, I end up with pretty much as much data as the disk image is long. So since my C is really rusty, I'll post this here so that someone with the time can create a proper detection with file length and all.

User avatar
Site Admin
Posts: 5427
Joined: 18 Feb 2012, 15:08
Location: Le Perreux Sur Marne, France

Re: Git repository recovery

#2 Post by cgrenier »