Git PullRequest job failed. Couldn't find any revision to build. Verify the repository and branch configuration for this job

Yesterday my pullrequest jobs failed with the following output:

11:07:41  > git rev-parse origin/${sha1}^{commit}
11:07:41  > git rev-parse ${sha1}^{commit}
11:07:41 ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job.

I have made an investigation and saw that in property ${sha1} there was nothing. When i paste an absolute path to pull request builder like pr/341/merge instead of ${sha1} the build works. What it can be?

  • Is it possible to let Gerrit randomly pick a reviewer?
  • Running a remote PowerShell script with a Git command in it results in NativeCommandError
  • Can't install GitHub on Windows 7 (64 bit)
  • Using Git to Figure out How Long a Line of Text Has Been In a File
  • How to migrate from a complicated subversion repository to a distributed version control system?
  • why config folder is not pushed?
  • Git Client Plugin
    1.9.0

    GitHub API Plugin
    1.44

  • How to color file names in git log?
  • Do all git commands have a dry-run option?
  • git svn rebase index file open failed : Invalid argument
  • In Git, can you retrieve the date when you pulled a certain commit from the repo?
  • Git LFS files not found on server
  • Can't add files to git repository
  • 3 Solutions collect form web for “Git PullRequest job failed. Couldn't find any revision to build. Verify the repository and branch configuration for this job”

    As stated here, If you want to manually build the job, in the job setting check This build is parameterized and add string parameter named sha1 with a default value of master. When starting build give the sha1 parameter commit id you want to build or refname (eg: origin/pr/9/head).

    I spent a long time on this. The above comment “if I leave this field blank” worked like a charm. In SCM:
    1) select Git
    2) Name: origin
    3) Refspec: +refs/pull/*:refs/remotes/origin/pr/*
    4) Branches to build : leave blank

    This solved the above error.

    sometimes this happens if “Branch Specifier” is not set properly.
    I corrected specifier and it worked for me.

    */release/release4.5.0
    

    or

    */fetaure/myfeature
    
    Git Baby is a git and github fan, let's start git clone.