Enforce specific flow for commits across branches in git/github

Viewed 31

We have branches A, B and C. We want to enforce a process such that all commits follow this flow:

                PR      PR      PR    
Feature Branch ----> A ----> B ----> C

How might it be possible to achieve this?

To express it another way, we want to prevent commits to B that have not been first applied to A and prevent commits to C that have not first been applied to B.

Or yet another way to say it is that commits to B should only ever be FF merges from A (and so on)

1 Answers

I've written a shell script that helps to accomplish this. It's located here:

https://bitbucket.org/js29a/git-flow.git

If somebody is interested I can write more examples and add a tutorial.

It works on trees, so you can do the joins in any pattern. The script stops on first merge conflict.

Related