I have a hair-splitting edge case where I need a commit to BranchA to be immediately merged into BranchB, and I'd like this to be automated.
I tried looking up steps to commit to 2 branches at the same time and found this, but I don't know how to automate it.
I'm aware of .git/hooks/post-commit
but I'm not sure if the commit exists before the hook runs or after the script exits 0. Also I don't know if the git merge
command can merge to a branch we're not checked out too.
Is this something I can do with just git? Or do I need to invent a complicated rube-goldberg system of file-watchers?