jenkinsci / jenkinsci/git-plugin

[JENKINS-46883] Git Push Event Broken when switching repo URLs

Open
#3,190 0 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

Problem

Internally, we have consolidated Github repositories and as a result, had to update repository URLs in Jenkins jobs to point to their new locations. In the process of this, changing the Git URL in Pipeline jobs and committing code did not trigger the Github Push on the Pipeline jobs. I can see the Push events come through in the Jenkins logs but the Github Hook Log seems to still show the old URL log results and does not update. 


Steps to Reproduce



  1. Stand up a Jenkins master (I did in Docker)

  2. Create two different Github repos (repo1,repo2)

    1. Include a Jenkinsfile that just has:

      node { echo 'hello repo1(make this repo2 for repo2)' }




  1. Create a Pipeline job

    1. For our particular job, we have set the branch specifier as */tags/* to build tags



  2. Create a tag on the repo (v1.0)

  3. Run a build and see that it built (v1.0) successfully via manual trigger (without the hook triggering a tag)

  4. Set up a Github webhook on repo1 (send all events to make it easy) to the Jenkins server

  5. Make a small change to the echo statement in the Jenkinsfile for repo1

  6. Create a tag and see that the job is successfully triggered from the Github webhook

  7. ** Notice the Github Hook Log is showing that the tag is fetched properly from repo1

  8. Go back to the job configuration page and change the Git URL to point to repo2

  9. Set up a Github webhook on repo2 (send all events to make it easy) to the Jenkins server

  10. Create a tag on repo2

  11. ** Expected echo 'hello repo2' but it is still displaying 'hello repo1'

    1. The Github Hook Log is also showing the tags from repo1 being fetched



 

Is there some sort of state stored? If I create a brand new Pipeline job that points to repo2 the tagging trigger all works. But vice versa, if I change that URL back to repo1, it will not trigger on repo1 tag creation. 

---
Originally reported by ahuang, imported from: Git Push Event Broken when switching repo URLs


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

Raw content of original issue

Problem

Internally, we have consolidated Github repositories and as a result, had to update repository URLs in Jenkins jobs to point to their new locations. In the process of this, changing the Git URL in Pipeline jobs and committing code did not trigger the Github Push on the Pipeline jobs. I can see the Push events come through in the Jenkins logs but the Github Hook Log seems to still show the old URL log results and does not update. 


Steps to Reproduce



  1. Stand up a Jenkins master (I did in Docker)

  2. Create two different Github repos (repo1,repo2)

    1. Include a Jenkinsfile that just has:

      node { echo 'hello repo1(make this repo2 for repo2)' }





  1. Create a Pipeline job

    1. For our particular job, we have set the branch specifier as */tags/* to build tags



  2. Create a tag on the repo (v1.0)

  3. Run a build and see that it built (v1.0) successfully via manual trigger (without the hook triggering a tag)

  4. Set up a Github webhook on repo1 (send all events to make it easy) to the Jenkins server

  5. Make a small change to the echo statement in the Jenkinsfile for repo1

  6. Create a tag and see that the job is successfully triggered from the Github webhook

  7. ** Notice the Github Hook Log is showing that the tag is fetched properly from repo1

  8. Go back to the job configuration page and change the Git URL to point to repo2

  9. Set up a Github webhook on repo2 (send all events to make it easy) to the Jenkins server

  10. Create a tag on repo2

  11. ** Expected echo 'hello repo2' but it is still displaying 'hello repo1'

    1. The Github Hook Log is also showing the tags from repo1 being fetched



 

Is there some sort of state stored? If I create a brand new Pipeline job that points to repo2 the tagging trigger all works. But vice versa, if I change that URL back to repo1, it will not trigger on repo1 tag creation. 

  • environment: Jenkins 2.60.2, Git Plugin 3.5.1

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.