diff --git a/lib/workers/global/config/parse/env.spec.ts b/lib/workers/global/config/parse/env.spec.ts
index 4aa0158a87e62a26c2e6c35f829706821ad9396b..3b8398455bb5f2181368adc52765c5ce31f935ff 100644
--- a/lib/workers/global/config/parse/env.spec.ts
+++ b/lib/workers/global/config/parse/env.spec.ts
@@ -114,6 +114,21 @@ describe(getName(), () => {
       expect(res).toMatchSnapshot();
       expect(res.hostRules).toHaveLength(2);
     });
+    it('regression test for #10937', () => {
+      const envParam: NodeJS.ProcessEnv = {
+        GIT__TAGS_GITLAB_EXAMPLE__DOMAIN_NET_USERNAME: 'some-user',
+        GIT__TAGS_GITLAB_EXAMPLE__DOMAIN_NET_PASSWORD: 'some-password',
+      };
+      const res = env.getConfig(envParam);
+      expect(res.hostRules).toMatchObject([
+        {
+          hostType: 'git-tags',
+          matchHost: 'gitlab.example-domain.net',
+          password: 'some-password',
+          username: 'some-user',
+        },
+      ]);
+    });
     it('supports datasource env token', () => {
       const envParam: NodeJS.ProcessEnv = {
         PYPI_TOKEN: 'some-token',
diff --git a/lib/workers/global/config/parse/env.ts b/lib/workers/global/config/parse/env.ts
index 3fa43334fb8a14091b8432db04fc9aa6b41a35e0..646f5f6b5a816b60e2281247a4c00d541311573e 100644
--- a/lib/workers/global/config/parse/env.ts
+++ b/lib/workers/global/config/parse/env.ts
@@ -100,7 +100,7 @@ export function getConfig(env: NodeJS.ProcessEnv): AllConfig {
       continue; // eslint-disable-line no-continue
     }
     // Double underscore __ is used in place of hyphen -
-    const splitEnv = envName.toLowerCase().replace('__', '-').split('_');
+    const splitEnv = envName.toLowerCase().replace(/__/g, '-').split('_');
     const hostType = splitEnv.shift();
     if (datasources.has(hostType)) {
       const suffix = splitEnv.pop();