Closed bewards closed 5 years ago
The same question.
That doesn't look right indeed. Can you guys describe your environment, settings as well as how is your repository structure? Is it just the user folder?
Also you can run bin/plugin git-sync status
to get some configurations view. Please be careful with what you paste in here as this is publicly viewable.
Another thing you can check is how your sparsecheckout git config look like, from the root of the project run a cat user/.git/info/sparse-checkout
I don't know whether it's the right method or not but seem I solved it this way:
The issue was when I tried to set up Sync with existing the whole repository (as we can get with option 3: Install from GitHub from install guide)
My Grav site is hosted on Linode Ubuntu 18.04 LTS.
Running bin/plugin git-sync status
locally gives the following (user/pass actually came up as null):
Running bin/plugin git-sync status
on the server gives the following:
plugin runtime information:
array:17 [
"branch" => "master"
"enabled" => true
"folders" => "['pages', 'themes', 'plugins']"
"git" => array:5 [
"author" => "gituser"
"name" => "GitSync"
"email" => "git-sync@trilby.media"
"bin" => "git"
"message" => "(Grav GitSync) Automatic Commit"
]
"gitVersion" => "2.17.1"
"isGitInitialized" => true
"logging" => false
"password" => "REMOVED"
"remote" => array:2 [
"name" => "origin"
"branch" => "master"
]
"repository" => "https://github.com/bewards/tech-blog-grav.git"
"repositoryPath" => "/home/grav/www/html/user/"
"sync" => array:5 [
"on_save" => true
"on_delete" => true
"on_media" => true
"cron_enable" => false
"cron_at" => "0 12,23 * * *"
]
"text_var" => "Custom Text added by the **Git Sync** plugin (disable plugin to remove)"
"username" => "bewards"
"webhook" => "REMOVED"
"webhook_enabled" => "0"
"webhook_secret" => "REMOVED"
]
detect git workspace root:
/home/grav/www/html/user
...
Working state is not clean.
Running cat user/.git/info/sparse-checkout
locally returns "No such file or directory" as there is no .git directory underneath /user
. On the server there is a .git directory underneath /user
, so running is on the server gives the following:
pages/
pages/*
themes/
themes/*
plugins/
Looks like your gitsync instance is misconfigured or somewhat broken. You should definitely have a .git folder under user for all the git configurations of your repo and sparse checkout.
Try enabling gitsync logging and try going through the wizard once again. Also try to save the plugin after the wizard is done.
Thanks @w00fz - resolved by walking through the wizard again and updating the web hook to ssl and re-saving with the webhook secret. After saving, I now see the .git
directory under /user
.
This can be closed.
Awesome, glad it’s resolved 👍
Being relatively new to Grav I may not fully understand why it's doing this, but when I add a plugin or a blog page via admin panel on my live site, the sync commits blog page files (from the server) under
/pages/01.blog/[blog page]
instead of/user/pages/01.blog/[blog page]
, as well as/plugins/
instead of/user/plugins/
.When I pull these changes down locally, none of the pages i've published live or plugins are available and have to be moved in to the user folder.
Then if I commit and push up some custom css under
user/themes/mytheme/css
or add a partial underuser/themes/mytheme/templates/partials
in order to override some markup from the default theme (that works locally) and hit Synchronize, I don't see these files being added to that directory location on the server.In the public site admin panel I do have the wizard configured for Pages, Themes, and Plugins.