So, I guess you could just do in your build step: git checkout master git merge origin/master # do your thing git commit git push origin master
And then start thinking how to change your build process so that you no longer need to make commits during the build... :) -- Sami 2012/3/5 Matthias <[email protected]>: > Hi, > > I'm running into a problem with Git and Jenkins here and have no idea why > that is. The thing is, we don't want to work in detached HEAD mode, since > part of our build is keeping track of a ProGuard mapping file that is > updated only ever during the build itself. This means we have to build on > master, not detached, so that we can create a commit and push it. > > However, regardless what I do, Jenkins refuses to merge changes from origin > before it executes the build. This seems very strange; why would it work on > a stale local branch instead of the latest one? I even tried going to > "Advanced" settings of the Git plugin and filled in "Merge before build" > (with "origin" and "master"), although I believe this is only meant to be > used for integration branches? Anyway, it has no effect either: > > Commencing build of Revision aa194e067103efa1ba23bc0a3a767bbb4846fca4 > (origin/master) > Merging Revision aa194e067103efa1ba23bc0a3a767bbb4846fca4 (origin/master) > onto $BRANCH > Seen branch in repository origin/HEAD > Seen branch in repository origin/acceptance_tests > Seen branch in repository origin/acra_custom_error_notifications > Seen branch in repository origin/actionbar > Seen branch in repository origin/enhanced_upload_notification > Seen branch in repository origin/ignited_lm > Seen branch in repository origin/master > Seen branch in repository origin/mwc > Seen branch in repository origin/remove_old_rpx > Seen branch in repository origin/robo_tests > Seen branch in repository origin/vf2 > Seen branch in repository origin/vodafone > [workspace] $ /bin/bash -x /tmp/hudson4018151321281891494.sh > + git checkout master > Previous HEAD position was aa194e0... Fix pro guard to not crash on 1.6 > devices on task errors due to NFC. > Switched to branch 'master' > Your branch is behind 'origin/master' by 1 commit, and can be > fast-forwarded. > Parsing POMs > > ... > > > > As you can see, the merge never happens. > > How can I tell the Git plugin to merge origin/master before performing the > build? ^^ > > Thanks, > Matthias
