To build your pipelines, you may need the name of the branch on which the pipeline is running. In most cases, the predefined variables CI_COMMIT_BRANCH
or CI_COMMIT_REF_NAME
can be used for this. According to GitLab Docs:

Once our team had a Mercurial (Hg) monorepo with 3 significant projects and several smaller ones with a 8-year history that included ~30000 commits. We set a goal to split the monorepo into multiple separated repositories and migrate each to Git with saving all the history. The goal looked unreachable, but the solution appeared to be quite simple.