Jenkins merge dev branch to master with -Xtheir stategy

Posted by Pandya M. Nandan on Stack Overflow See other posts from Stack Overflow or by Pandya M. Nandan
Published on 2014-05-29T15:12:28Z Indexed on 2014/05/29 15:26 UTC
Read the original article Hit count: 279

Filed under:

In GIT Plugin, we can merge one branch to other on work space before the starting of Build. However, plugin does not provide -Xtheir strategy. Now i want dev branch to merge on master, validate test cases and if successful then only push back to master.

Problem i face is that if there is a merge conflict, i want changes of dev branch to exits (i know i can use -Xtheirs manually). [Like i can check git as Source Code Management, but can;t use its Additional behavior 'Merge Before Build' ]

However when i run the required code in Execute Shell Section of Jenkins Job, It does not works as required and fails with error:

    fatal: dev - not something we can merge

Jenkins Job Code is

    echo Start of Build
    git checkout dev
    git checkout master
    git status
    git merge dev --no-commit
    echo End of Build

I have also used them with bask -l -c "", but is same problem.

© Stack Overflow or respective owner

Related posts about jenkins