Open Maaack opened 7 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.
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.
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.
The
main-plugin
branch should stay synced with themain
branch. This is being solved manually. An automated solution would be preferred.