Closed jaygorrell closed 6 years ago
What version of Git are you running? it has to be > 1.7.1
Hey, actually having the same problem. @jaygorrell did you solved this by any chance? We have git version 2.7.4 on server, and (almost) the same error message appears on saving a page. There's also another error on the plugin page: "On branch master Untracked files: .gitignore .gitkeep accounts/ blueprints/ config/ plugins/ themes/ nothing added to commit but untracked files present"
The local repo is set to "master", the remote repo is set to "final", which is the branch we want to sync with. Why does the plugin errors out on plugin and blueprint things, even though it only appears to sync the pages folder?
Hello, it seems I have a similar issue w git-sync. Did you guys ever resolve this? Btw, when I run git straight from command line (i.e when I use "git pull ..." etc.), then everything seems fine -- no conflicts, nothing. I only get this error when I use git-sync.
Here are the files that seem affected:
Any ideas?
TIA, -martin.
@cpannwitz sorry I missed your reply months ago.
@mlanser We did get it working but I have no idea why it required custom changes. Basically we had to tell git to ignore certain files using something like this (in our Dockerfile).
git ls-files -z themes/ | xargs -0 git update-index --assume-unchanged
You may need to adjust the folders but this worked for us -- basically tell git-sync to only monitor expected pages. We also have it ignoring other files mounted at runtime (Docker/Kubernetes environment).
@jaygorrell Thanks! I will try this and will see how far I get. The thing is, I have 3 diff Grav sites with identical config, etc. and GitSync says it's 'ok' on 1st, shows warning on 2nd, and error on 3rd. And for both 2nd and 3rd site it points to standard Grav folders that are marked as 'ignore' in the .gitignore file. Furthermore, all 3 sites show no issues when I run git from terminal ... so I guess it's a bit of a mystery.
Ah well, thats from some time ago. I'm remembering as well having to delete/move/ignore certain files and branches, to get this thing to work. I think basically the problem was, that we didn't initialize the branch (?) with the plugin (?), so it broke when it found some already existing stuff, which should't be a problem, since those files were the same.
But anyways, we moved away from Grav.
OK ... figured it out! I must have missed this somewhere in the instructions, but the trick seems to be that one has to start with a new/empty git repo. If you do that then GitSync only syncs 'user/pages' and it works just fine. I now have 2 repos: one for the Grav site itself where I manage custom plugins, themes, etc., and another for 'user/page'. And, of course, my '.gitignore' files ensure that I don't end up with overlapping repos.
This is essentially a vanilla Grav setup with Admin+GitSync. I have a repo that contains only the user directory contents, which I believe is how this plugin expects it to be. Plugin configuration is standard. Upon saving the settings I get the following:
The only thing potentially noteworthy is that I did not add the webhook to my repository because I only want one-way syncing. If changes happen in Github they will go through my deployment pipeline and get deployed properly anyway with a new image.
Because of this process, I also know no local files are modified. I did log into the instance and am able to manually re-run the failed git command:
None of these files are modified of course, but the more strange question to me is why only these in the error? Why not all the other files under
plugins/error/
? Since I'm using a standard setup, I'm wondering what is missing here.