Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何在管道中运行的作业中找到分支名称?我试过git branch了,我得到的是 * (detached from <commit number>) master
git branch
* (detached from <commit number>) master
有一个名为的预定义变量CI_BUILD_REF_NAME,其中包含分支名称。更多信息在这里
CI_BUILD_REF_NAME