CharlesChiuGit / Logseq-Git-Sync-101

This repo aims to help Logseq users to sync their data with Git and GitHub.
MIT License
1.06k stars 88 forks source link

fatal: cannot lock ref 'HEAD' #29

Closed szjani closed 1 year ago

szjani commented 1 year ago

I get this weird message on Windows if and only if I modified the graph on my iPhone. Although this message box appears, everything looks fine, the modifications are visible. Still, very annoying. If I manually run fetch or pull from Git bash, there is no such issue. image

CharlesChiuGit commented 1 year ago

r u kept both windows logseq and ios logseq opened at the same time while modifying one of those?

szjani commented 1 year ago

No, they are not opened at the same time. There is no conflict.

CharlesChiuGit commented 1 year ago

Sorry, this is beyond my pay grade. I'm not 100% sure how built-in git in logseq works. Personally I never ran into this after I use this plugin with manually git pull/push via it. Maybe consider give it a try?

szjani commented 1 year ago

I've setup Logseq on a Linux device and have the same issue. The ~/.gitconfig contains only the name and email address, nothing else.

CharlesChiuGit commented 1 year ago

So did u try the git plugin instead of built-in auto-commit?

szjani commented 1 year ago

No, not yet. I'm going to check that, but honestly I would not like to commit manually. And I think the issue happens during pull, in the pre-commit hook.

CharlesChiuGit commented 1 year ago

ys, I do know it's related to pull. Will be greatly appreciated if u have a better idea about pre-commit! PR is always welcomed.

szjani commented 1 year ago

Could not find any meaningful thing. I cannot even find Google hits that anyone is doing git pull in pre-commit hook. It is strange that it is only a problem for me and I can reproduce it both on Windows 11 and on Ubuntu.

Anyway, I've installed the git plugin, it works as expected. I'm sure it will happen that I cannot find something on my phone because I forgot to commit/push on desktop. :(

CharlesChiuGit commented 1 year ago

Sorry, this is the best solution I can provide so far. PR is always welcomed. Or maybe u can try the official logseq sync, which is pretty solid in my limited experience. Close this issue for now, feel free to reopen it in the future.