trilbymedia / grav-plugin-git-sync

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

Why --allow-unrelated-histories? #143

Closed drzraf closed 5 years ago

drzraf commented 5 years ago

It seems git pull is always run with --allow-unrelated-histories when Git > 2.9.0. I don't understand the underlying motivation. I think this should not be the default but rather the exception.

w00fz commented 5 years ago

This is part of git-sync historically to prevent erroring out when users switch repository or start over with a new blank repo at a different location. It’s not going to cause issues if the repository switched to is completely different as there will be merge conflicts but often times what is expected is to be able to move to different services to start fresh and without the flag enabled it will not be able to do so.

The reason it’s for git 2.9.0 and above only is because the flag was not available before that.

I’m open to make this an advanced option that can be turned off (so enabled by default) if this is causing you issues for you.