jenkinsci / jenkinsci/git-plugin

[JENKINS-26482] Git trigger build on push in any branch

Open
#2,589 5 comments 0 reactions 0 assignees View on GitHub
component:git-plugin imported-jira-issue priority:major resolution:unresolved
Dominant language
Java
Stars
694
Forks
1.1k
Avg merge
1h 29m
Merged PRs (30d)
3

Description

I want to trigger build if someone commit in Bitbuket's specific branch. Current...

I want to trigger build if someone commit in Bitbuket's specific branch. Currently we can mention which branch to build but on setting remote triggers it trigger build on code commit in any branch not only in given branch.

I set Jenkins hook as well as post receive hook which triggers build remotely but by giving branch name it give error that no git repo or branch is set.

http://server/jenkins/git/notifyCommit?url=git@​bitbucket.org:myrepogit[&branches=dev]

Gives Response:

No git jobs using repository: git@​bitbucket.org:myrepo,git[ and branches: dev]

No Git consumers using SCM API plugin for: git@​bitbucket.org:myrepo.git[

http://jenkins/git/notifyCommit?url=https://bitbucket.org/myrepo

works fine and triggers build but as soon as I mention branch in url like:

http://server/jenkins/git/notifyCommit?url=git@​bitbucket.org:myrepogit[&branches=dev] ;

No git jobs using repository: git@​bitbucket.org:myrepo,git[ and branches: dev]

No Git consumers using SCM API plugin for: git@​bitbucket.org:myrepo.git[

---
Originally reported by faisalalirabbani, imported from: Git trigger build on push in any branch


  • status: Open
  • priority: Major
  • component(s): git-plugin
  • resolution: Unresolved
  • votes: 2
  • watchers: 9
  • imported: 2025-12-02

Raw content of original issue

I want to trigger build if someone commit in Bitbuket's specific branch. Current...
I want to trigger build if someone commit in Bitbuket's specific branch. Currently we can mention which branch to build but on setting remote triggers it trigger build on code commit in any branch not only in given branch.
I set Jenkins hook as well as post receive hook which triggers build remotely but by giving branch name it give error that no git repo or branch is set.

http://server/jenkins/git/notifyCommit?url=git@bitbucket.org:myrepogit[&branches=dev]
Gives Response:
No git jobs using repository: git@bitbucket.org:myrepo,git[ and branches: dev]
No Git consumers using SCM API plugin for: git@bitbucket.org:myrepo.git[

http://jenkins/git/notifyCommit?url=https://bitbucket.org/myrepo
works fine and triggers build but as soon as I mention branch in url like:
http://server/jenkins/git/notifyCommit?url=git@bitbucket.org:myrepogit[&branches=dev] 

No git jobs using repository: git@bitbucket.org:myrepo,git[ and branches: dev]
No Git consumers using SCM API plugin for: git@bitbucket.org:myrepo.git[

1 attachment

- [jenkins-gitPlugin-buildsForAllBranches.png](https://raw.githubusercontent.com/jenkinsci/attachments-from-jira-issues-last/refs/heads/main/attachments/28781/jenkins-gitPlugin-buildsForAllBranches.png)
> ![jenkins-gitPlugin-buildsForAllBranches.png](https://raw.githubusercontent.com/jenkinsci/attachments-from-jira-issues-last/refs/heads/main/attachments/28781/jenkins-gitPlugin-buildsForAllBranches.png)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.