Maaack / Godot-Game-Template

Godot template with a main menu, options menus, pause menu, credits, scene loader, extra tools, and an example game scene.
MIT License
454 stars 28 forks source link

Keep `main-plugin` synced with `main` #43

Open Maaack opened 6 months ago

Maaack commented 6 months ago

The main-plugin branch should stay synced with the main branch. This is being solved manually. An automated solution would be preferred.

Shoghy commented 5 months ago

You could try using git hooks, but unfortunately, hooks don't get uploaded to the GitHub repository, or at least the ones stored in the ./.git/hooks directory. However, you could create a .githooks directory and run

git config --local core.hooksPath .githooks/

so git execute the hooks stored in the .githooks directory, but you will need to run that command each time you change of computer.

Shoghy commented 5 months ago

If you're willing to do this, I think you just need to create file called post-commit inside the .githooks directory with the content:

#!/bin/sh
git checkout main-plugin
git merge main
git checkout main

and that should keep main-plugin synced with main, if there is no conflict.

Maaack commented 5 months ago

Thanks for the suggestions! I expect I'd need additional logic to switch back to my original branch, or only run the code when merging on main. This should help for merges done on my machine.

Though I do hope there is a solution that would work on GitHub, as I often handle merge requests through the web interface.