Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

git-sync doesn't work with multisites #173

Closed
frunika opened this issue Jun 14, 2020 · 7 comments
Closed

git-sync doesn't work with multisites #173

frunika opened this issue Jun 14, 2020 · 7 comments

Comments

@frunika
Copy link

frunika commented Jun 14, 2020

#33 was closed but still an issue

I made a fresh install of grav v1.6.26 for grav.domain.org.
Setup a setup.php for subdomains, added a grav-admin skeleton in a /user/sites/sub.domain.org/

Used the sub.domain.org/admin Adminpanel to install git-sync v2.1.0 and used the wizard.

Got the "FETCH_HEAD fatal: refusing to merge unrelated histories" problem and solved it using git pull origin master --allow-unrelated-histories.

The wizard made a .git dir in user/ and not in user/sites/sub.domain.org/ and therefore git-sync syncs the main site grav.domain.org user/pages/ and not user/sites/sub.domain.org/pages

Is there a workaround? I cannot the anything in the referenced PR in #95

@frunika
Copy link
Author

frunika commented Jun 24, 2020

Any idea how to fix this?

@mahagr
Copy link
Collaborator

mahagr commented Jul 1, 2020

@w00fz Do you know the answer?

@frunika
Copy link
Author

frunika commented Jul 3, 2020

I got it to work by moving/copying the .git directory and the .gitignore.

cp -r /path/to/grav/user/.git/ /path/to/grav/user/sites/sub.domain.org/
cp /path/to/grav/user/.gitignore /path/to/grav/user/sites/sub.domain.org/.gitignore

Additionally you have to set the local_repository option in /path/to/grav/user/sites/sub.domain.org/config/plugins/git-sync.yaml correctly to where the page is located:

local_repository: '/path/to/grav/user/sites/sub.domain.org/'

@frunika
Copy link
Author

frunika commented Jul 3, 2020

The better way is, to edit the git-sync.yaml before entering the wizard and adding local_repository: '/path/to/grav/user/sites/sub.domain.org/'

The wizard will then use the correct path to create the repository.

You could create an empty .git folder in /path/to/grav/user/ to avoid the wizard to start every time.

@w00fz w00fz removed their assignment Jul 16, 2020
@w00fz
Copy link
Member

w00fz commented Jul 16, 2020

I am afraid I don't really have suggestions for multi-sites. I never had the need for using it as i just find it quicker to spin off a new Grav site.

If anyone has suggestions or would like to help making GitSync multi-site compatible, PR are more than welcome!

@w00fz w00fz closed this as completed in 4325513 Jul 17, 2020
@w00fz
Copy link
Member

w00fz commented Jul 17, 2020

Hey @frunika, regarding the unrelated histories, I finally got to the bottom of this issue and it appears a regression was introduced where the method returning the git version would always return true instead of the actual version.

Because the version check is necessary to ensure certain git features get enabled (like allow-unrelated-histories), the regression would prevent that from happening.

I have now fixed this and @paulhibbitts kindly helped testing this confirming it's fine. A new release v2.1.1 is out and you shouldn't be needing manually running the command from terminal anymore, as long as your git version is > 2.9.0 (which is fairly old now).

Give it a try!

@frunika
Copy link
Author

frunika commented Jul 19, 2020

Hi @w00fz, thank's for the update. I'll give it a try later. It seems it fixes the git problem, also described in #168 . But it has nothing to do with the multisite support, does it? I think the issue should be reopend.

We may need an update in the GUI (blueprint?) of the plugin, where one could enter a specific folder (or just the subsite).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants