Reputation: 31
My configuration :
Name of the repository : [email protected]:xyz/Jenkins-Build
Name of the Branch : $BITBUCKET_SOURCE_BRANCH (which one is coming with the pull request from bitbucket
This is the Output of the configuration :
Using 'Changelog to branch' strategy. fatal: bad revision '^[email protected]:xyz/Jenkins-Build' ERROR: Unable to retrieve changeset hudson.plugins.git.GitException: Error: git whatchanged --no-abbrev -M "--format=commit %H%ntree %T%nparent %P%nauthor %aN <%aE> %ai%ncommitter %cN <%cE> %ci%n%n%w(0,4,4)%B" -n 1024 1ebf4e2e54b895fd2fadf4a22edd2972fafc0669 ^[email protected]:xyz/$BITBUCKET_SOURCE_BRANCH in /home/jwilson/Jenkins/workspace/nexus-cloud at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$6.execute(CliGitAPIImpl.java:1176) at hudson.plugins.git.GitSCM.computeChangeLog(GitSCM.java:1305) at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1217) at hudson.scm.SCM.checkout(SCM.java:504) at hudson.model.AbstractProject.checkout(AbstractProject.java:1206) at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:574) at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:499) at hudson.model.Run.execute(Run.java:1838) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:429)
Upvotes: 3
Views: 1031
Reputation: 61
You need to use "origin" instead of repository URI.
In Git, the term "origin" is a conventional name that refers to the default remote repository where your local repository was cloned. It acts as a shorthand reference for the remote repository URL. When you clone a repository, Git automatically creates a remote named "origin" to simplify pushing and pulling changes.
So, if you want to calculate what is changing against a specific repository branch (for example main?) - you need to use the repository name: "origin" and the branch name "main"
I know that my answer may be too late, but it can be helpful for someone else.
Upvotes: 0