Skip to content

Runner doesn't set Git branch correctly

No idea how to describe this correctly, so here's just examples:

I run the command git rev-parse --abbrev-ref HEAD to determine the name of the currently checked out branch.

In my local Git repository, it gives me the correct name of the active branch.

In the GitLab runner environment (latest Windows runner) it just says “HEAD”. That's pretty useless to me.