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

Windows Instructions do not work GitHub does not trust PC without SSH ????? #25

Closed thorrrr closed 1 year ago

thorrrr commented 1 year ago

Hi I have tried following your instructions but GitHub will not allow connection image

You say do not use SSH but github help says to avoid this error use ssh ?????

CharlesChiuGit commented 1 year ago

SSH-key without passward is preferred

doesn't mean do not use ssh-keys.

Please, use the ssh-key.

thorrrr commented 1 year ago

SSH-key without passward is preferred

doesn't mean do not use ssh-keys.

Please, use the ssh-key.

HI Charles But your Windows docs do not mention this!

CharlesChiuGit commented 1 year ago

It's in https://github.com/CharlesChiuGit/Logseq-Git-Sync-101/wiki/%F0%9F%AA%9C-Workflow. Please read all the guilds if you're not familiar with git , thanks.

thorrrr commented 1 year ago

It's in https://github.com/CharlesChiuGit/Logseq-Git-Sync-101/wiki/%F0%9F%AA%9C-Workflow. Please read all the guilds if you're not familiar with git , thanks.

HI Sorry i didnt see that i have SSH from my Linux laptop for same repo can i use that if i copy the key into my windows machine or should i make a new ssh key ?

CharlesChiuGit commented 1 year ago

Every machine should has their own ssh-key, please make a new one for your windows machine.

thorrrr commented 1 year ago

Every machine should has their own ssh-key, please make a new one for your windows machine.

OK thank you so one i have set up a new ssh doi i just follow the windows instructions as i have a repiosirtry already i just need to pull from github as i have no loqseq files on my Windows yet?

CharlesChiuGit commented 1 year ago

Yes exactly!

CharlesChiuGit commented 1 year ago

Do remember to update the git-hooks.

thorrrr commented 1 year ago

Do remember to update the git-hooks.

I have added a SSH key into Github from this PC and when i try again with Git now it says it does not exsist ???

$ git clone git@github.com:{thxxxxx}/{logseq}.git Cloning into '{logseq}'... fatal: remote error: is not a valid repository name

In Linux this worked flawlesley

CharlesChiuGit commented 1 year ago

Did you literally type {} in the command line?

Please remove it

U should be typing sth like git clone git@github.com:CharlesChiuGit/logseq.git

thorrrr commented 1 year ago

Sorry fixed and working now Thank You for your patience

thorrrr commented 1 year ago

HI Charles NOt sure if i screwed up yesterday but everything came through to my WIndows machine. But i now get errors on my laptop From github.com:thorrrr/logseq ceccf99..e8a4c20 main -> origin/main Updating ceccf99..e8a4c20 Fast-forward pages/Contents.md-3 | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 pages/Contents.md-3 fatal: cannot lock ref 'HEAD': is at e8a4c20b64a7040591510065bcaed23d55cc5f82 but expected ceccf99ffac298cf15a623ac49ef19060a6e7d75

If you don't want to see those errors or don't need git, you can disable the "Git auto commit" feature on Settings > Version control.

Also on my iPad i can see the pages but they no longer commit what the pull from Github Could you point me how to fix it please no doubt i have made an error

CharlesChiuGit commented 1 year ago

fatal: cannot lock ref 'HEAD': is at e8a4c20b64a7040591510065bcaed23d55cc5f82 but expected ceccf99ffac298cf15a623ac49ef19060a6e7d75

This kind of error often happens when u open 2 logseq instances at once, for example, one on windows and one on iPad. See https://github.com/CharlesChiuGit/Logseq-Git-Sync-101/wiki/Prerequisite#%EF%B8%8F-things-you-should-avoid

Also on my iPad i can see the pages but they no longer commit what the pull from Github

Did you close and re-open logseq on ipad? B/c the shortcut I provide in this repo will only be activate during Open Logseq app and Close Logseq app. U need to re-open Logseq on ipad to pull the latest commit from your github repo. If this doesn't work out, then u might have a git conflict issue, please refer to https://github.com/CharlesChiuGit/Logseq-Git-Sync-101/wiki/%F0%9F%92%A5-FAQ#what-is-git-conflict

thorrrr commented 1 year ago

Hi Charles I have my laptop and my IOS devices working fine re sync with Workin Copy App. But my Windows App is not picking anything up. I can see in the git folder data from today but the app is not seeing it ? Plus anything i add in Windows does not show up on any other device.

image

Not sure if Git is screwed on my Windows machine or i have it setup wrong

thorrrr commented 1 year ago

I have done a git status and pull and it looks to have grabbed them but i thought this method was automatic. Anything i add in the Windows Logseq is not being pushed across i dont think! I have my version set to 60 but it still takes 5 min not sure why , but nothing on my Windows machine!

image

CharlesChiuGit commented 1 year ago

As u can you have a git conflict on your windows machine, so nothing can be pushed or pulled at this moment, not until u fix the conflict.

The best approach for u now is to move what's not being pushed, re-do setup on your windows machine, add new notes back and try to push again.

This git sync method is indeed automatic, but now u have a git conflict, so it has been blocked until u solve it.

thorrrr commented 1 year ago

I have just been to git irc for help. I am even more confused they say the version control settings in logseq is stupid and not needed !!!! Git would work without and have refused to help told me to go back to logseq

CharlesChiuGit commented 1 year ago
  1. I never heard of "git irc", wtf is it?
  2. Despite git in logseq is stupid, u need it.
  3. I have a hard time understanding your English.
  4. So did u do what I said in the previous comment?
  5. Can u please read the manual/wiki first?
thorrrr commented 1 year ago

I am re doing everything from scratch as you mentioned but i do not understand No 7 Copy&paste the post-commit and pre-commit in .git/hooks. (Note: this folder could be hidden)

image

image

GIT IRC

image

CharlesChiuGit commented 1 year ago

1.

  1. Copy&paste the post-commit and pre-commit in .git/hooks. (Note: this folder could be hidden)

.git is a folder..., and there's a hooks folder inside .git folder... Just copy&paste the bloody files to the .git/hooks folder. Please read EVERY LINE in the ENTIRE wiki, not just read the windows section. Here's the wiki. Clearly, you don't know how to debug and don't know how git works, so read everything I wrote in the wiki, don't skip any section.

  1. This screenshot you took has already said what needs to be fixed, so fix it. If you don't know how to fix it, google the error.
CharlesChiuGit commented 1 year ago

If you don't want to deal with git, you can always choose to paid for Logseq Sync. Here's the link.

thorrrr commented 1 year ago

HI Charles Thank you i decided to fllow your advice plus support the Loqseq Team. Could you tell me how to stop Git from syncing on my laptop and Pc do i disable options in Github or on my machines. I would use Logseq Sync to Syync I was thinking of just using Git as a backup to Github if possible Could you advice or point me to docs to find out how to do this ?

CharlesChiuGit commented 1 year ago

Could you tell me how to stop Git from syncing on my laptop and Pc do i disable options in Github or on my machines.

Just remove the .git folder and you'll be good! 👍

thorrrr commented 1 year ago

You mean the one on each machine the .git image

CharlesChiuGit commented 1 year ago

ys, each .git folder in your Logseq graph.

thorrrr commented 1 year ago

Hi Charles I have deleted it but when i open Logseq i get an errror .git missing and a new .git file bac in folder ??

image The new .git file is created each time with this code in it gitdir: /home/dale/.logseq/git/_home_dale_Loggy/.git

CharlesChiuGit commented 1 year ago

Okey, then delete that .git file and .gitignore and toggle off the Enable Git auto commit option in Logseq settings. 圖片

thorrrr commented 1 year ago

Cheers worked a treat

CharlesChiuGit commented 1 year ago

nice!