Helix Core is now P4. Product user interfaces will be updated soon. Learn more >>

P4 Server Administration Documentation | 2025.2

# Configuring Git Connector to poll repos

Your organization might have contributors in multiple locations that are geographically remote from one another, like Brazil and Japan. The administrator of the Git Connector at each location might want the local Git Connector to periodically get the latest version of a set of repos. This can enable the end-users for a given location to experience fast clones and fetches.

## Polling and the server spec

The administrator configures the server spec with a list of repos in the UpdateCachedRepos field with a separate line for each repo:

`UpdateCachedRepos:
//graphDepotName/repo1
//graphDepotName/repo3
//graphDepotName/repo4`

1. The administrator in Brazil uses the `p4 server` command to edit the server specification that corresponds to the `ServerId` for the instance of the Git Connector in Brazil. The administrator specifies the set of repos for which Brazil wants the latest updates.

   The administrator populates lines under the UpdateCachedRepos: field in the server spec to contain a set of repos, with each repo path on its own separate line:

   ServerID: gconn-hq-centos6
   Name:
   Address: 1669
   UpdateCachedRepos:
   //graphDepotName/repo1
   //graphDepotName/repo3
   //graphDepotName/repo4
   Type: connector
   Services: git-connector
   Options: nomandatory
   Description: GitConnector service to mirror a subset of repos

2. At the Git Connector command-line, the Brazil administrator:
   1. Sets the environment variable `GCONN_CONFIG` to the absolute path to the `gconn.conf` file:

   `export GCONN_CONFIG=/opt/perforce/git-connector/gconn.conf`

   2. Runs the command `gconn poll-repos` and verifies that this manual test has pulled the latest for the set of repos:

      Command-Line Output | Meaning
      --- | ---
          Polling repo: //graphDepot/repo1
          From p4gc://brazilURL/graphDepoA/repo1
          * [new branch]      branchName    -> branchName
      | Brazil gets a new branch for this repo
          Polling repo: //graphDepot/repo3
          From p4gc://brazilURL/graphDepoA/repo3
          784a8e8..e6a5604  branchName   -> branchName
      | Brazil gets an update for this repo
          Polling repo: //graphDepot/repo4
      | Brazil is already has the latest for this repo

3. (Optional) The Brazil administrator might choose to configure the UNIX cron utility to schedule an automatic run of the `gconn poll-repos` command at a specified interval. For example, `etc/cron.d/gconn` can poll for updated repos every 10 minutes:

   `*/10 * * * * git /usr/bin/gconn poll-repos`

The administrator for Japan can edit the server spec associated with the Japan Git Connector such that this server spec for Japan contains none, some, or all of the repos as the server spec for Brazil. Similarly, the administrator for Japan might set up a different interval for polling.

## Polling with a command that includes explicit repo names

The administrator can choose to poll repos in a manner that is independent of the server specification.

1. The administrator instead explicitly specifies which particular repo or repos to poll:

   `gconn poll-repos //graphDepot/repo1 //graphDepot/repo27`

2. (Optional) The administrator can configure the UNIX cron utility for the previous command.

Your search for returned results