- a script that can make all necessary changes, with no manual intervention.
- check out master, run the script, commit the result
git fetch origin
git checkout master
git checkout -b apply-script
"<script>"
git commit -m -"apply script"
git push origin apply-script
-
get changes merged to master
-
make a new branch ("base") and revert the commit in which you ran the script, and push it (this branch will never get merged)
git fetch origin
git checkout master
git checkout -b base
git revert :/'apply script'
git push origin base
- use filter-branch to apply changes to feature branch.
git checkout your-feature-branch
git fetch origin
git rebase origin/base
git filter-branch --tree-filter "<script>" origin/master..HEAD
git rebase origin/master
git push origin your-feature-branch --force-with-lease
Thanks @avh4 for the guidance on this!