I added a script in my workflow, to make merge conflicts visible early in the development process. Perhaps this can help others too.
For each commit, I’d like to know if it could cause merge conflicts to (in my case)
develop . So at the end of my normal workflow where I run the unit tests, I check out the
develop branch, try to merge the changed branch, and run unit tests on the result.
This helps me to find merge conflicts sooner in our development process.
Here is the script build step that works for me:
#!/usr/bin/env bash # fail if any commands fails set -e # debug log set -x TARGET_BRANCH="develop" SOURCE_BRANCH="$BITRISE_GIT_BRANCH" git reset --hard git "checkout" "$SOURCE_BRANCH" git merge "origin/$SOURCE_BRANCH" git fetch "origin" "$TARGET_BRANCH" git reset --hard git checkout origin/$TARGET_BRANCH git merge $SOURCE_BRANCH