git storage sync does not work if the remote *is* the local repository on the same machine #7860
Unanswered
Gremious
asked this question in
Error / Bug Report
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I've encountered an issue after setting up the git storage sync.
Notably, I don't really need/use GitHub or some such for this, as I self host wikijs on my own server without docker.
So I can just
git clone username@myserver:/path/to/wikijs/repoand I'm good to go, as ssh servers are also git servers.As such, I've created a
wikijsuser, pointed the repo to/srv/wikijsand set the git repository url in the storage options towikijs@localhost:/srv/wikijs.After setting up ssh keys and what not, it works with 1 exception:
Pressing "Force Sync" or letting the sync timer run does not fetch/display locally made commits. This is on bi-directional mode.
The other options work:
Pressing "Add Untracked Changes" syncs the updates from the wiki to the files on the server/repo.
Pressing "Import Everything" gets all the commits from the local repo and displays them on the wikijs.
However, if I e.g. ssh into my server, edit my notes "offline", commit, and then press "force sync" - nothing really happens. I do not see my updates.
The issue seem to stem with the sync code flow. It:
wiki/server/modules/storage/git/storage.js
Lines 121 to 123 in 407aacf
git pull --rebasewiki/server/modules/storage/git/storage.js
Lines 126 to 131 in 407aacf
wiki/server/modules/storage/git/storage.js
Lines 144 to 146 in 407aacf
However, because the repo is always up to date, the current and new commit hash are always the same.
I will leave it up to you guys decide how to address this, of course, but my 2 cents are that wikijs probably needs to keep track of what commit it's on itself, instead of relying on git.
Thank you =)
Beta Was this translation helpful? Give feedback.
All reactions