hudson.plugins.git.GitException: Command "git push git@bitbucket.org:elosystemsteam/paypoint-potter.git HEAD:B2-Bisque" returned status code 1: stdout: stderr: To git@bitbucket.org:elosystemsteam/paypoint-potter.git ! [rejected] HEAD -> B2-Bisque (non-fast-forward) error: failed to push some refs to 'git@bitbucket.org:elosystemsteam/paypoint-potter.git' hint: Updates were rejected because a pushed branch tip is behind its remote hint: counterpart. Check out this branch and merge the remote changes hint: (e.g. 'git pull') before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details.

Jenkins JIRA | Michael Power | 3 years ago
  1. 0

    This could be a bug in the bitbucket plugin bitbucket plugin version: 1.0 Git plugin version: 2.2.1 Jenkins version: 1.532.2.3 See stackoverflow question: http://stackoverflow.com/questions/23203806/cloudbees-prebuild-merge-no-longer-works If I configure a job to do a merge before the build then let SCM trigger the job it does not do a merge before the build. Since I have also turned on the git publisher the push fails because the target branch has diverged. The build is supposed to merge the source branch and the target branch together and push it back to target. If I kick off the build manually the the merge is done before the build and the git publisher runs without error. Approximate steps to reproduce. Create job named mergeAndBuild Configure mergeAndBuild to use git Configure mergeAndBuild to look for changes on sourceBranch and targetBranch Add merge before build to git configuration Name of repository: Origin Branch to merge to: targetBranch Merge strategy: default Enable bitbucket build trigger. Add git publisher to the build Push Only If Build Succeeds: yes Merge Results: yes Make sure the bitbucket hook is configured with your jenkins server. Then do something like the following git clone giturl git checkout -b sourceBranch touch sourceBranch.txt git add sourceBranch.txt git commit -m "Add sourceBranch.txt" git checkout master git checkout -b targetBranch touch targetBranch.txt git add targetBranch.txt git commit -m "Add targetBranch.txT" git push origin targetBranch:targetBranch git push origin sourceBranch:sourceBranch At this point it will build and the log will say: commit notification 6161e4adb567c8be106ee8fa70594d67a756e481 Building remotely on 5a988271 in workspace /scratch/jenkins/workspace/da/b2.potter Fetching changes from the remote Git repository Fetching upstream changes from git@bitbucket.org:elosystemsteam/paypoint-potter.git Checking out Revision 6161e4adb567c8be106ee8fa70594d67a756e481 (detached) Then towards then end when the git publisher tries to push: Pushing HEAD to branch B2-Bisque of origin repository ERROR: Failed to push merge to origin repository hudson.plugins.git.GitException: Command "git push git@bitbucket.org:elosystemsteam/paypoint-potter.git HEAD:B2-Bisque" returned status code 1: stdout: stderr: To git@bitbucket.org:elosystemsteam/paypoint-potter.git ! [rejected] HEAD -> B2-Bisque (non-fast-forward) error: failed to push some refs to 'git@bitbucket.org:elosystemsteam/paypoint-potter.git' hint: Updates were rejected because a pushed branch tip is behind its remote hint: counterpart. Check out this branch and merge the remote changes hint: (e.g. 'git pull') before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details. at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1276) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1146)

    Jenkins JIRA | 3 years ago | Michael Power
    hudson.plugins.git.GitException: Command "git push git@bitbucket.org:elosystemsteam/paypoint-potter.git HEAD:B2-Bisque" returned status code 1: stdout: stderr: To git@bitbucket.org:elosystemsteam/paypoint-potter.git ! [rejected] HEAD -> B2-Bisque (non-fast-forward) error: failed to push some refs to 'git@bitbucket.org:elosystemsteam/paypoint-potter.git' hint: Updates were rejected because a pushed branch tip is behind its remote hint: counterpart. Check out this branch and merge the remote changes hint: (e.g. 'git pull') before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details.
  2. 0

    This could be a bug in the bitbucket plugin bitbucket plugin version: 1.0 Git plugin version: 2.2.1 Jenkins version: 1.532.2.3 See stackoverflow question: http://stackoverflow.com/questions/23203806/cloudbees-prebuild-merge-no-longer-works If I configure a job to do a merge before the build then let SCM trigger the job it does not do a merge before the build. Since I have also turned on the git publisher the push fails because the target branch has diverged. The build is supposed to merge the source branch and the target branch together and push it back to target. If I kick off the build manually the the merge is done before the build and the git publisher runs without error. Approximate steps to reproduce. Create job named mergeAndBuild Configure mergeAndBuild to use git Configure mergeAndBuild to look for changes on sourceBranch and targetBranch Add merge before build to git configuration Name of repository: Origin Branch to merge to: targetBranch Merge strategy: default Enable bitbucket build trigger. Add git publisher to the build Push Only If Build Succeeds: yes Merge Results: yes Make sure the bitbucket hook is configured with your jenkins server. Then do something like the following git clone giturl git checkout -b sourceBranch touch sourceBranch.txt git add sourceBranch.txt git commit -m "Add sourceBranch.txt" git checkout master git checkout -b targetBranch touch targetBranch.txt git add targetBranch.txt git commit -m "Add targetBranch.txT" git push origin targetBranch:targetBranch git push origin sourceBranch:sourceBranch At this point it will build and the log will say: commit notification 6161e4adb567c8be106ee8fa70594d67a756e481 Building remotely on 5a988271 in workspace /scratch/jenkins/workspace/da/b2.potter Fetching changes from the remote Git repository Fetching upstream changes from git@bitbucket.org:elosystemsteam/paypoint-potter.git Checking out Revision 6161e4adb567c8be106ee8fa70594d67a756e481 (detached) Then towards then end when the git publisher tries to push: Pushing HEAD to branch B2-Bisque of origin repository ERROR: Failed to push merge to origin repository hudson.plugins.git.GitException: Command "git push git@bitbucket.org:elosystemsteam/paypoint-potter.git HEAD:B2-Bisque" returned status code 1: stdout: stderr: To git@bitbucket.org:elosystemsteam/paypoint-potter.git ! [rejected] HEAD -> B2-Bisque (non-fast-forward) error: failed to push some refs to 'git@bitbucket.org:elosystemsteam/paypoint-potter.git' hint: Updates were rejected because a pushed branch tip is behind its remote hint: counterpart. Check out this branch and merge the remote changes hint: (e.g. 'git pull') before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details. at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1276) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1146)

    Jenkins JIRA | 3 years ago | Michael Power
    hudson.plugins.git.GitException: Command "git push git@bitbucket.org:elosystemsteam/paypoint-potter.git HEAD:B2-Bisque" returned status code 1: stdout: stderr: To git@bitbucket.org:elosystemsteam/paypoint-potter.git ! [rejected] HEAD -> B2-Bisque (non-fast-forward) error: failed to push some refs to 'git@bitbucket.org:elosystemsteam/paypoint-potter.git' hint: Updates were rejected because a pushed branch tip is behind its remote hint: counterpart. Check out this branch and merge the remote changes hint: (e.g. 'git pull') before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details.
  3. 0

    Using Jenkins and cygwin on windows node triggered job by GitHub

    Stack Overflow | 10 months ago | Viorel Mirea
    hudson.plugins.git.GitException: Failed to fetch from git@github.com:project_name.git
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    cloudbees prebuild merge no longer works

    Stack Overflow | 3 years ago | user3557614
    hudson.plugins.git.GitException: Command "git push git@bitbucket.org:elosystemsteam/paypoint-potter.git HEAD:B2-Bisque" returned status code 1: stdout: stderr: To git@bitbucket.org:elosystemsteam/paypoint-potter.git ! [rejected] HEAD -> B2-Bisque (non-fast-forward) error: failed to push some refs to 'git@bitbucket.org:elosystemsteam/paypoint-potter.git' hint: Updates were rejected because a pushed branch tip is behind its remote hint: counterpart. Check out this branch and merge the remote changes hint: (e.g. 'git pull') before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details.
  6. 0

    shaddock-openstack-service-build #28 failed

    GitHub | 2 weeks ago | epheo
    hudson.plugins.git.GitException: Command "git push git@github.com:epheo/shaddock-openstack.git HEAD:master" returned status code 1: stdout: stderr: To github.com:epheo/shaddock-openstack.git ! [rejected] HEAD -> master (non-fast-forward) error: failed to push some refs to 'git@github.com:epheo/shaddock-openstack.git' hint: Updates were rejected because a pushed branch tip is behind its remote hint: counterpart. Check out this branch and integrate the remote changes hint: (e.g. 'git pull ...') before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details.

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. hudson.plugins.git.GitException

      Command "git push git@bitbucket.org:elosystemsteam/paypoint-potter.git HEAD:B2-Bisque" returned status code 1: stdout: stderr: To git@bitbucket.org:elosystemsteam/paypoint-potter.git ! [rejected] HEAD -> B2-Bisque (non-fast-forward) error: failed to push some refs to 'git@bitbucket.org:elosystemsteam/paypoint-potter.git' hint: Updates were rejected because a pushed branch tip is behind its remote hint: counterpart. Check out this branch and merge the remote changes hint: (e.g. 'git pull') before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details.

      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn()
    2. org.jenkinsci.plugins
      CliGitAPIImpl.launchCommandWithCredentials
      1. org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1276)
      2. org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1146)
      2 frames