trilbymedia / grav-plugin-git-sync

Collaboratively Synchronize your Grav `user` folder hosted on GitHub, BitBucket or GitLab
Apache License 2.0
243 stars 58 forks source link

plugin deleted all themes except quark #130

Closed jeremycherfas closed 3 years ago

jeremycherfas commented 5 years ago

I thought I would try to use the plugin again, and again it deleted all themes except Quark, which meant that I could not even get into admin to delete the plugin.

I don't know enough to work out the problem. I do know I've now tried twice, and neither time have I had any success.

w00fz commented 5 years ago

I'm not sure why Quark would be any different, there certainly is anything specific in the code for it.

jeremycherfas commented 5 years ago

What more info would you need?

w00fz commented 5 years ago

I’d like to be able to reproduce this consistently so perhaps you could outline step by step what I need to do if I start from a fresh grav+admin setup?

jeremycherfas commented 5 years ago

I did not have a fresh setup. I had a pre-existing site. I normally write and tweak on a local site, push to github and then use a webhook to update the production site.

I installed the plugin on the production site and pointed it to the existing github repo of \user.

Then I did a couple of tests, creating a post in production, fetching it locally, editing it, pushing it back, and when I went to check for the changes in the live site, I could not get in at all because my theme was missing. All themes (Antimatter and my child of Antimatter) were missing, except Quark.

I had to revert everything to a commit before I started attempting to use the plugin.

Later, when I raised an issue elsewhere https://github.com/cmadland/phd/issues/14#issuecomment-462788186 it turned out that the plugin advises using a new repo, and changed the readme accordingly, but in my opinion it is not clear why it wouldn't work with an existing repo or that a fresh repo actually seems mandatory.

w00fz commented 5 years ago

@jeremycherfas when you say you pointed to an existing github repo of /user, do you mean you had a whole Grav site in GitHub and you tried to point the repository in GitSync to the subfolder /user?

If that's the case, that won't work. GitSync expects the user folder to be the root of your repository, exactly like the skeletons.

jeremycherfas commented 5 years ago

I already had a working Grav install, as outlined, with a repo on github, a clone locally and a clone on my live production site. This was based on the instructions on the Grav blog some while ago. https://getgrav.org/blog/developing-with-github-part-1

In general, I sync only the /user folder of my Grav install, again as suggested in one of the blog posts.

Nowhere did I read that the gitsync plugin syncs the entire install. And nowhere have I seen that the /user folder is the root of the install. The /user folder is in the root at the same level as other bits of the Grav install.

In my view the instructions for the plugin are somewhat inadequate and the Wizard should at the very least warn me if I am doing something that won't work.

There is the additional confusion that the plugin asks you specifically which folders you want to sync. What is the point of that if it is going to sync the entire install?

bobbwal commented 4 years ago

I've just had this same problem. Really struggling to get this to work well. I'm syncing only my user folder.

jeremycherfas commented 4 years ago

Good luck. I gave up.

paulhibbitts commented 4 years ago

Hi @bobbwal , did you start with a fresh Git repo with only one commit? Were you using Git in any way with the same Grav install before Git Sync?

If it might help, I've got a video walkthrough of Git Sync as a reference - https://www.youtube.com/watch?v=96CqtxL7WaQ&list=PLk2Bz5X36nXBSZqb9w8x-BmxkaJwCDJkc&index=9&t=0s

I am not a dev but have used Git Sync for many projects, please feel free to connect with me in the Grav Discord room https://chat.getgrav.org/