jenkinsci / jenkinsci/git-plugin

[JENKINS-21536] GIT_BRANCH should not change after merge

Open
#2,412 4 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 checkout origin/myBranch. Because last commit is also on master branch the GIT_BRANCH is set to master.

Similar issue when I use "merge before use" option and set "branch to merge to" GIT_BRANCH is set to latest commit(in this case origin/master) not the checkouted branch.

---
Originally reported by fugi, imported from: GIT_BRANCH should not change after merge


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

Raw content of original issue

I checkout origin/myBranch. Because last commit is also on master branch the GIT_BRANCH is set to master.

Similar issue when I use "merge before use" option and set "branch to merge to" GIT_BRANCH is set to latest commit(in this case origin/master) not the checkouted branch.

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.