I have setup jenkins to build all feature branches in a project and before the build merge them to 'develop' since I'm more interested if the result of the merge builds rather than the feature branch itself.
This seem to work if the feature branch is based of develop HEAD but if the branch off point is before develop HEAD then jenkins says: ERROR: Branch not suitable for integration as it does not merge cleanly
And this would be alright if there was a conflict. But there is no conflict. I have tested the merge manually in the console and the merge is automatically done.
Also if comparing the feature branch and develop in atlassian stash it also shows a clean diff without any conflicts.
I'm lost. Why can't jenkins merge it?
creating pull requests. Avoid allowing pull requests to become stale. Make sure you're not changing the same lines of code before merging a prior change. Establish and follow formatting rules.
To see the beginning of the merge conflict in your file, search the file for the conflict marker <<<<<<< . When you open the file in your text editor, you'll see the changes from the HEAD or base branch after the line <<<<<<< HEAD .
Git doesn't overwrite until you mark the files with conflicts as resolved (even though if they really aren't). Git doesn't try to be smart with merging. When you merge, if it can merge cleanly, it will do so. If it cannot, it will halt the merge process and mark the conflicts which you should resolve manually.
I found it myself. It was because git on the jenkins server wasn't configured with author name/email.
After configuring this (under additional behaviours) solved the problem.
I also found that this error occurred if Jenkins/git was configured to do a shallow clone. If you are shallow cloning you'll need to disable it:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With