phacility/phabricator · error · Exception

This repository ("%s") is not a Git repository. Use "%s" to

Error message

This repository ("%s") is not a Git repository. Use "%s" to interact with this repository.

What it means

DiffusionGitSSHWorkflow serves git-upload-pack/git-receive-pack over SSH. When the repository identified from the SSH path exists but its version control system is not Git, raiseWrongVCSException throws and names the repository's actual VCS so the right client is used.

Source

Thrown at src/applications/diffusion/ssh/DiffusionGitSSHWorkflow.php:57

      PhabricatorRepositoryType::REPOSITORY_TYPE_GIT);
  }

  protected function waitForGitClient() {
    $io_channel = $this->getIOChannel();

    // If we don't wait for the client to close the connection, `git` will
    // consider it an early abort and fail. Sit around until Git is comfortable
    // that it really received all the data.
    while ($io_channel->isOpenForReading()) {
      $io_channel->update();
      $this->getErrorChannel()->flush();
      PhutilChannel::waitForAny(array($io_channel));
    }
  }

  protected function raiseWrongVCSException(
    PhabricatorRepository $repository) {
    throw new Exception(
      pht(
        'This repository ("%s") is not a Git repository. Use "%s" to '.
        'interact with this repository.',
        $repository->getDisplayName(),
        $repository->getVersionControlSystem()));
  }

  protected function newPassthruCommand() {
    return parent::newPassthruCommand()
      ->setWillWriteCallback(array($this, 'willWriteMessageCallback'))
      ->setWillReadCallback(array($this, 'willReadMessageCallback'));
  }

  protected function newProtocolLog($is_proxy) {
    if ($is_proxy) {
      return null;
    }

View on GitHub (pinned to 5720a38cfe)

Solutions

  1. Use the client matching the repository (hg or svn) with the exact URI shown on its Diffusion main page
  2. If the repository should be Git and is empty or misconfigured, recreate it with the correct VCS type
  3. Check the repository's Version Control System setting under Manage
Defensive patterns

Strategy: validation

Validate before calling

// Confirm VCS matches before launching the Git SSH workflow
if ($repository->getVersionControlSystem() !==
    PhabricatorRepositoryType::REPOSITORY_TYPE_GIT) {
  // tell the client to use the VCS-appropriate tool
}

Prevention

When it happens

Trigger: Running git clone ssh://<user>@<host>/diffusion/<CALLSIGN>/ (or git fetch/push) against a repository configured as Mercurial or Subversion.

Common situations: Copying the wrong clone URL from another repository; creating the repository with the wrong VCS type; muscle-memory git usage on mixed-VCS installs.

Related errors


AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21). Data as JSON: /api/errors/f23d1e2b68f63c4e. Report an issue: GitHub.