From inside simply run the modularize script. The modularize script will then in turn execute each scripts/\d+.* in order, ensuring that cwd is set to at start. It also provides some convenience functions for running each command with exit code checking. Put your custom patches in the patches directory, and use $basepath/patches to refer to them when needed. The execution order is as follows: 1. 100-799 scripts: Moves files to their new locations. 2. All the moved files are committed. 3. Patches in the patches/ folder are committed. 4. 800-899 scripts: Custom commit scripts that commit fixes on top of the moved repositories. Use this for commits that can change across Qt versions, and therefore cannot be represented by a simple patch. 5. 900-999 scripts: Scripts that create new repositories out of each module directory. 6. A qt5 repository is created, containing all the other Git repositories.