jenkinsci / jenkinsci/git-plugin

[JENKINS-26271] Building a git tag doesn't work with multiple remotes

Open
#2,579 2 comments 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

In the git plugin, when multiple repository URLs are configured (note: two remotes, not MultiSCM), building a git tag does not find the correct commit.

Steps to reproduce:



  1. Create a job with two git repository URLs (note: two remotes, not MultiSCM). Ensure you name give the second one a different remote name. For example:

    origin -> git://github.com/blt04/jenkins-test1.git
    
    upstream -> git://github.com/blt04/jenkins-test2.git

  2. Run a build using master

  3. Configure the branch to be a tag: "test2-1.0"

  4. Run the job

Expected results:

Builds the tag

Actual results:

Builds the last built revision

---
Originally reported by blt04, imported from: Building a git tag doesn't work with multiple remotes


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

Raw content of original issue

In the git plugin, when multiple repository URLs are configured (note: two remotes, not MultiSCM), building a git tag does not find the correct commit.

Steps to reproduce:



  1. Create a job with two git repository URLs (note: two remotes, not MultiSCM). Ensure you name give the second one a different remote name. For example:

    origin -> git://github.com/blt04/jenkins-test1.git
    
    upstream -> git://github.com/blt04/jenkins-test2.git


  2. Run a build using master

  3. Configure the branch to be a tag: "test2-1.0"

  4. Run the job

Expected results:
Builds the tag

Actual results:
Builds the last built revision

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.