Most of version control (VCM) tool and practices , code is managed in multiple branches (Like Project Branch(Branched from the Master Branch) and as code deploys to PRODUCTION (Or higher instances) code merges/integrates back to the Master branch.This step in most of organizations (& as CICD evolves across organization) this would be good is automated and scripted (as a Post or a Pre Migration step) instead of user merging the code back to master branch manually.
Current Problem with STAT is that the Pre-Post Migration scripts are not suitable for executing this kind of scripts as part of the migration .
Simple article illustrating how gitHub is used https://guides.github.com/introduction/flow/