jenkinsci / jenkinsci/git-plugin

[JENKINS-27426] Git Plugin should record the initial branch when completing a merge before build

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

Description

When checking out a branch and then merging another branch into the branch, the original branch is lost.

Configure the job to checkout origin/develop. Add a merge before build to merge origin/master into the workspace. This causes git-plugin to checkout master and then merge develop into the workspace. The current branch is now master.

In the event that the original branch or commit needs to be passed to another job, this information is no longer available.

---
Originally reported by mattfirtioncoveros, imported from: Git Plugin should record the initial branch when completing a merge before build


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

Raw content of original issue

When checking out a branch and then merging another branch into the branch, the original branch is lost.

Configure the job to checkout origin/develop. Add a merge before build to merge origin/master into the workspace. This causes git-plugin to checkout master and then merge develop into the workspace. The current branch is now master.

In the event that the original branch or commit needs to be passed to another job, this information is no longer available.

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.