jenkinsci / jenkinsci/git-plugin

[JENKINS-25465] ${GIT_BRANCH} macro expands full branch name + remotes instead of short name

Open
#2,558 5 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

Docs says that ${GIT_BRANCH} macro should expands to the full branch name, such as 'origin/master'. Otherwise(without fullName parameter), it only expands to the short name, such as 'master', but without fullName parameter it expands to 'remotes/origin/master' with fullName parameter it doesn't work at all.

---
Originally reported by metyl, imported from: ${GIT_BRANCH} macro expands full branch name + remotes instead of short name


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

Raw content of original issue

Docs says that ${GIT_BRANCH} macro should expands to the full branch name, such as 'origin/master'. Otherwise(without fullName parameter), it only expands to the short name, such as 'master', but without fullName parameter it expands to 'remotes/origin/master' with fullName parameter it doesn't work at all.

environment

```
Centos OS 6,

git version 1.7.12.4,

Jenkins ver. 1.588,

GIT plugin 2.2.7

```

1 attachment

- [Parameters.PNG](https://raw.githubusercontent.com/jenkinsci/attachments-from-jira-issues-misc/refs/heads/main/attachments/31297/Parameters.PNG)
> ![Parameters.PNG](https://raw.githubusercontent.com/jenkinsci/attachments-from-jira-issues-misc/refs/heads/main/attachments/31297/Parameters.PNG)

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.