How can i do a reset with GitSCM?

21 views
Skip to first unread message

red 888

unread,
Apr 17, 2018, 7:51:27 PM4/17/18
to Jenkins Users
I want to merge a branch into the current one but reset the current branch to the one I'm merging in:

checkout([$class: 'GitSCM',
branches
: [[name: "${env.BRANCH_NAME}"]],
doGenerateSubmoduleConfigurations
: false,
extensions
: [
   
[$class: 'PreBuildMerge',
        options
: [
            fastForwardMode
: 'NO_FF',
            mergeRemote
: 'origin',
            mergeStrategy
: 'MergeCommand.Strategy',
            mergeTarget
: 'otherbranch']
     
],
]
])

Is there an "except their changes" feature here? Actually I think I want a full reset because I want origin here to be identical to otherbranch

Mark Waite

unread,
Apr 17, 2018, 11:42:14 PM4/17/18
to jenkins...@googlegroups.com
There is a strategy called "OURS" and a strategy called "RECURSIVE_THEIRS".  Will either of those do what you want?

Mark Waite

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/dfdb1112-fbdb-4929-87d7-0aebf3e4c553%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

red 888

unread,
Apr 18, 2018, 1:48:15 PM4/18/18
to Jenkins Users
hey thats cool. I'll have to test that, where is that in the docs? I couldn't find it anywhere maybe it was right under my nose.
Reply all
Reply to author
Forward
0 new messages