jenkinsci / jenkinsci/git-plugin

[JENKINS-54740] Jenkins running build for every branch in repository.

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

Description

User has configured a job with branch specifier "**".  When the user ran the build, Jenkins ran a build for every branch in the repository.  We've seen this before.  The twist here is that we upgraded the Jenkins hardware, and Jenkins version. We did an rsync of the old jenkins data directory to the new server.  On the old server, the job only ran when a new commit was pushed to the repository, and only the branch that changed.

 

This ticket is more of a question than a problem since we expect this for a fresh install, but we were surprised that the builds were running for every branch since we copied the original workspace.  

 

The question than is how does jenkins keep track of which branches/commits have been built?  What additional files, and/or precautions do we need to take to make sure this does not happen again.  We are unable to locate any documentation that explains exactly how the git plugin manages to keep track of which commits have been build.

---
Originally reported by michael_giroux, imported from: Jenkins running build for every branch in repository.


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

Raw content of original issue

User has configured a job with branch specifier "**".  When the user ran the build, Jenkins ran a build for every branch in the repository.  We've seen this before.  The twist here is that we upgraded the Jenkins hardware, and Jenkins version. We did an rsync of the old jenkins data directory to the new server.  On the old server, the job only ran when a new commit was pushed to the repository, and only the branch that changed.

 

This ticket is more of a question than a problem since we expect this for a fresh install, but we were surprised that the builds were running for every branch since we copied the original workspace.  

 

The question than is how does jenkins keep track of which branches/commits have been built?  What additional files, and/or precautions do we need to take to make sure this does not happen again.  We are unable to locate any documentation that explains exactly how the git plugin manages to keep track of which commits have been build.

environment

```
Jenkins 2.138.3

Git-Plugin 3.9.1

Linux ${HOSTNAME} 3.10.0-862.14.4.el7.x86_64 #1 SMP Fri Sep 21 09:07:21 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

```

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.