jesseduffield/lazygit · warning

Unsupported git service

Error message

Unsupported git service

What it means

HostingServiceMgr.getServiceDomain matches the repo URL against candidate service domains (defaults like github.com, plus user-configured `services` entries) by substring Contains. If none match, it returns UnsupportedGitService: lazygit cannot tell which hosting service (github/gitlab/gitea/...) provides the web API for PRs/issues.

Source

Thrown at pkg/commands/hosting_service/hosting_service.go:144

	}

	return &Service{
		repoURL:           repoURL,
		repoName:          repoName,
		ServiceDefinition: serviceDomain.serviceDefinition,
	}, nil
}

func (self *HostingServiceMgr) getServiceDomain(repoURL string) (*ServiceDomain, error) {
	candidateServiceDomains := self.getCandidateServiceDomains()

	for _, serviceDomain := range candidateServiceDomains {
		if strings.Contains(repoURL, serviceDomain.gitDomain) {
			return &serviceDomain, nil
		}
	}

	return nil, errors.New(self.tr.UnsupportedGitService)
}

func (self *HostingServiceMgr) getCandidateServiceDomains() []ServiceDomain {
	serviceDefinitionByProvider := map[string]ServiceDefinition{}
	for _, serviceDefinition := range serviceDefinitions {
		serviceDefinitionByProvider[serviceDefinition.provider] = serviceDefinition
	}

	serviceDomains := slices.Clone(defaultServiceDomains)

	for gitDomain, typeAndDomain := range self.configServiceDomains {
		provider, webDomain, success := strings.Cut(typeAndDomain, ":")

		// we allow for one ':' for specifying the TCP port
		if !success || strings.Count(webDomain, ":") > 1 {
			self.log.Errorf("Unexpected format for git service: '%s'. Expected something like 'github.com:github.com'", typeAndDomain)
			continue
		}

View on GitHub (pinned to c477a2959b)

Solutions

  1. Add the domain to lazygit config: `services: \"mygit.example.com:gitlab:mygit.example.com\"` (gitDomain:webDomain format is `<provider>:<webDomain>` under the remote's host)
  2. Or fix the remote URL to the real domain: `git remote set-url origin git@mygit.example.com:group/repo.git`
  3. Check `git remote -v` — the URL string literally must contain a known domain

Example fix

# before
$ git remote -v
origin  git@corp-git:team/repo.git   # ssh alias, no match -> error

# after
# ~/.config/lazygit/config.yml
services:
  "corp-git": "gitlab:corp-git.example.com"
# and/or fix the remote:
git remote set-url origin git@corp-git.example.com:team/repo.git
Defensive patterns

Strategy: validation

Validate before calling

remoteUrl, _ := cmd.New([]string{"git", "remote", "get-url", "origin"}).RunWithOutput()
known := []string{"github.com", "gitlab.com", "bitbucket.org" /* + configured domains */}
matched := slices.ContainsFunc(known, func(d string) bool { return strings.Contains(remoteUrl, d) })
if !matched {
    return fmt.Errorf("no hosting service for %s; add a services entry", remoteUrl)
}

Try / catch

Pre-resolve the remote URL and check it against known domains before invoking hosting-service features; on UnsupportedGitService, prompt the user for a `services:` config entry rather than failing silently.

Prevention

When it happens

Trigger: Remotes on self-hosted GitLab/Gitea/Bitbucket with custom domains not present in config services; SSH remotes with an alias host from ~/.ssh/config; short/rewrite URLs that don't contain the real domain.

Common situations: Corporate self-hosted git servers; users whose origin is `git@mycompany-git:group/repo.git` (ssh alias); trying the create-PR flow on a plain local repo with no remote.

Related errors


AI-assisted analysis of jesseduffield/lazygit@c477a2959b (2026-08-15). Data as JSON: /api/errors/f32cc3fa558bf1d4. Report an issue: GitHub.