Open ndarilek opened 2 years ago
I'm not a maintainer but I want to add that I understand your frustration.
This plugin seems to be setup for a very specific use case (it was developed for a client, I believe, so fair enough) and should come with warnings for anything else because it is potentially destructive (of uncommitted changes, anyway).
I'm so glad I read your comment before trying this on an existing repository. I made a file backup because not all of my local changes to that repo were staged yet.
I read through the code and it seems quite zealous.
I've decided I'm looking for something a little different for my content editors. I really want them to be able to review their changes and then commit them locally (and ideally keep them away from awful Git terminology!). I don't know so much about Git Hooks, but I am under the impression I can set them up and they will take care of the rest of the deployment workflow. No need to set up remotes via the plugin.
Perhaps this should have been put into Discussions here. I've made a clone and started greatly simplifying it for my purposes and this may end up as a new plugin. There are other (not abandoned) Git libraries too and not all require PHP exec, so gonna try them out. I am grateful to this plugin for the starting point. I am out of time now. I will share it as a simpler and safer alternative plugin if it becomes releasable.
Anyway, I think my TLDR is that the README should include more warnings about suitable and risky use cases.
Thanks, please let me know if you make another plugin. I've got this system working on 3 sites now, and each time I basically copied the config and fixed it until it worked. I didn't want to risk the installer trashing my repo like it did before I wised up to its ways. :)
I think next time I'm going to try installing the plugin into a stock Grav site to see if it works better. Maybe if Grav makes the first push, I can just pull and copy in a dev environment that disables git-sync locally. I think that might not trash anything but I can't say for sure. This whole process is finicky enough that I'm not thrilled about experimenting with it. :)
@ndarilek thanks for your patience. Docs probably need a review in light of recent development and are still patchy in parts, but happy to answer questions you might have: https://github.com/hughbris/grav-plugin-pushy
+100
The first time I tried to use this plugin was a few years ago and it sent me automatic changes that I then recommitted. Removed.
Today I try again. Again automatic commits, git reset --hard
, loss of a bunch of local folders, files, nerves. It's good that I pre-packed my folder into a zip. Several attempts to reset everything and I did as it was before this plugin.
The saddest thing is that in my case, it rewrote my .gitignore
, and then auto-committed all .DS_Store
in each of the folders (gitignor-ed before). Madness.
I just want to push/pull changes in the /pages
folder to git (localhost and production sites) through the Admin WHEN I WANT TO.
P.S. While I was writing this comment and saving the plugin configuration, I again got an auto-commit with DS_Store
. I didn't send anything, all options are off. It's just impossible.
P.P.S. It also changed my .git/config
:
[user]
name = GitSync
email = git-sync@trilby.media
but this is only needed with githook, because now when I try to commit in normal way, I see this name in my git app:
Plus sparsecheckout = true
option that I don't need at all... only gave problems with normal commits
I do the following
error: bad index file sha1 signature fatal: index file corrupt
Every time.
error: bad index file sha1 signature fatal: index file corrupt
This seems like a valid issue but also does not seem related to this one (as far as I can see, anyway).
Used this plugin for the first time a couple days ago. It very unexpectedly trashed everything and completely broke my site.
Yes, please, change this. It ruined my day.
Here's my typical Grav workflow. Note that I'm fairly new to Grav, so maybe I'm doing something dumb:
And this is where all hell breaks loose. Grav proceeds to trash my git config, the biggest and most damaging change being converting the repo to a sparse checkout and trashing .gitignore.
Maybe there's some benefit to this, but I generally set up my repo the way I like and don't really appreciate this plugin trashing it. I wish there was a "just set up SSH/auth, pull and push" mode for folks like me who've already set up our repositories the way we want and don't need quite as much handholding. Maybe there is already and I just don't know it.
At the moment I'm dealing with the fact that I carefully set up my git repo, only for this plugin to trash its copy of the repo. This particular hosting environment is stuck on Git v2.20, so it doesn't have nice sparse checkout support. I've gone through a bunch of howtos on how to disable this, but
git status
shows no changes to the remote website repo, even though bunches of files including my theme/accounts are just plain missing. Thankfully, because this copy of git is so old, it hasn't yet trashed my remote repo. Now I'm considering installing the git-sync plugin locally, but that'll just install it on a smart copy of git with the power to break the repo locally and, potentially, push those broken changes to the remote.Sorry if I seem cranky, but this bug has me genuinely frustrated. You've created an amazing power feature and basically strapped exploding training wheels on it. :) Is there some way to opt out of some of this advanced repo trashing? FWIW, I did jump through the hoops necessary to disable the sparse checkouts and a few other tweaks on another website and things seem to work, so to the best of my knowledge I'm not proposing shipping a tool with the safety off. I just don't think it should make a bunch of surprising changes to my repo, particularly in my dev environment. Reconfigure git with correct SSH paths, username and email? Fine. Monkeying with the checkout? Not so much.
Thanks.