简体   繁体   English

在管道中运行作业时找到当前的git分支

[英]find current git branch while running job in pipeline

how can I find out branch name in a job that is running in the pipeline? 如何在管道中运行的作业中找出分支名称? I tried git branch all i get is 我尝试了git branch我得到的是
* (detached from <commit number>) master

There is a predefined variable called CI_BUILD_REF_NAME that contains branch name. 有一个名为CI_BUILD_REF_NAME的预定义变量,其中包含分支名称。 for more info here 在这里获取更多信息

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM