[SOLVED] pijul git screwed my git repo?


First, it’s my fault not backing up things, but I by doing that:

> mkdir blog_pijul
> cd blog_pijul
> pijul git ../blog/

it would import blog into blog_pijul but instead, it modified my git repo and ended with an error (file not found and it didn’t say which one).

Now I’ve lost quite a bit of stuff and the repo is in an very old state. Is there a way to recover?


I wrote this issue : #672 the git command modifies the git folder about it.
When I wrote up my experience at Zulip, I saw that you could look in the ref log and see what had been done.

A compare of the original to the copy where I ran the import showed only the .git folder, the .pijul folder, and the .ignore file as changed. The .git/logs/refs/heads/trunk file had 8Meg instead of the original 197Bytes. I guess 53,000 resets adds up.

So you should be able to use git commands or looking at that file to find the original HEAD and reset to that.
Please add your viewpoint to the issue discussion to find a better way for this command to work.

1 Like

I found a copy of the repo which was not too old so I worked with that. But I tried your tip and I found the commit hash of the state I wanted and could restore it with a git reset --hard hash followed by git clean.

Thank you for your help!