'Jenkins - Couldn't find any revision to build

I have been using Jenkins for a few days, and before: I used the GITEA plugin Now that I have switched my projects to GitBucket, I would like to use the "Build by Webhook" Feature.

I followed many tutorials, and now : i'm stuck on a simple/big problem.

In advance, I'm sorry to have to blur the sensitive links, I know it can be annoying.

Here is the full error :

using credential 10
Wiping out workspace first.
Contributing variables:



Cloning the remote Git repository
Cloning repository https://MY_GITBUCKET/git/MY_USERNAME/MY_PROJECT
 > git init /Jenkins/workspace/GitBUcket # timeout=10
Fetching upstream changes from https://MY_GITBUCKET/git/MY_USERNAME/MY_PROJECT
 > git --version # timeout=10
 > git --version # 'git version 2.20.1'
using GIT_ASKPASS to set credentials Utilisateur GitBucket Perso
 > git fetch --tags --force --progress -- https://MY_GITBUCKET/git/MY_USERNAME/MY_PROJECT +refs/heads/*:refs/remotes/origin/* # timeout=10
 > git config remote.origin.url https://MY_GITBUCKET/git/MY_USERNAME/MY_PROJECT # timeout=10
 > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10
Avoid second fetch
Seen 0 remote branches
 > git show-ref --tags -d # timeout=10
ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job.
Finished: FAILURE

Here is my configuration on Jenkins : https://i.stack.imgur.com/jdlTt.png

Thank you very much in advance

EDIT : My only branche is master --> https://i.imgur.com/lXJ0xyN.png



Solution 1:[1]


This is what you can try:

  1. Manage Jenkins -> Global Tool Configuration -> Git
    • Check if Path to Git executable is set: C:\PATH\git.exe
  2. Dashboard -> select your job -> Configure -> Source Code Management -> select Git
    • Insert your Repository URL and Credentials(Optional) then under Branches to build change */master to */main.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Geri Caka