- Run
source setup.sh(or.\setup.ps1in PowerShell)
Doing local development we've created a bunch of commits. We would like to deliver them all to master. We would also like all commits to pass our tests.
Our test suite is contained in test.sh. We can use git rebase --exec to run the test suite for all commits. We have tagged the first commit in our history with initial-commit.
- Run the test script using
./test.shto see the most recent commit succeed - Use
git rebase -i --exec ./test.sh initial-committo run the test script on all commits. You will be shown the plan, you do not need to change anything. - The tests will run, and fail on a single commit. The tests fail because the test script changes. So you need to fix it
- Change the following strings in
test.shOne test failedtoall tests passexit 1toexit 0
- Stage
test.shand usegit commit --amendto fix the broken commit - Run
git rebase --continueto execute the test suite on the remaining commits - You may run
verify.sh(orverify.ps1in PowerShell) to verify your solution