Configure repos with a repo configuration file (p4gf_config)

  1. Copy the repo configuration file template, p4gf_config.repo.txt, to create a new config file.

    If you installed Git Fusion using the OVA or operating system specific packages, the template is in the /opt/perforce/git-fusion/libexec directory. If you installed using the distribution tarball, the location is the directory where you elected to install Git Fusion.

  2. Enter the key values and Helix Core-to-Git mapping (view) for your repo.

    Ensure that the Git work tree path notation on the view field's right side matches for all branches.

    Note

    Views can include overlay and exclusionary mappings, but note that the Git Fusion submit triggers (which enable atomic pushes) ignore exclusionary mappings, because the scope of submit triggers is limited to areas that are potentially of interest to Git Fusion. Exclusionary mappings are ignored for the calculation of areas of interest, because one repo's exclusions could conflict with another's inclusion.

    Note

    If in a given repo configuration, there is Helix Core path that is mapped to two or more Git branches, then that path is a "shared" path and thus read-only from the Git perspective.

    For detailed information about the repo configuration keys and view syntax, see the repo configuration file’s detailed header comments and Repo configuration file: key definitions and samples.

  3. Submit the repo configuration file to Helix Core.

    Save the file as p4gf_config.

    Submit the file to //.git-fusion/repos/repo_name/p4gf_config

    The repo_name can include the forward slash (/) and colon (:) characters, but these characters must be encoded as _0xS_ and _0xC_

    Note

    For example: repo name foo/bar:zee is created by submitting the following p4gf_config

    //.git-fusion/repos/foo_0xS_bar_0xC_zee/p4gf_config

  4. Initialize (populate) the repo.

    See Initializing repos on the Git Fusion server.

Repo configuration file: key definitions and samples

A repo-specific configuration file can include (and override) any property included in the global configuration file, in addition to the following.

Table 4. Repo-specific configuration files: keys and default values

Section Headers or Keys Definition Default Value Valid Values
[@repo] Section header for the repo configuration file. You can override any global configuration property by adding it to this section. NA Enter the section header exactly as shown.
description Repo description returned by the @list command NA Enter a concise repo description.
read-only Prohibit git pushes that introduce commits on any branch in this repository. No

Yes equivalent (Yes, On, 1, True) or No equivalent (No, Off, 0, False). Yes makes the repo read-only and prevents users from committing changes.

[git-fusion-branch-id] Section header to define a unique Git Fusion branch. NA Each branch must have a unique ID in the form of an alphanumeric string. Do not edit this value after you clone the repo.
git-branch-name Defines a name specified in a local repo for a Git branch. NA A valid Git branch name. Do not edit this value after you clone the repo.
view Defines a Helix Core workspace view mapping that maps Helix Core depot paths (left side) to Git work tree paths (right side). NA Correctly formed mapping syntax; must not include any Helix Core stream or spec depots, and all depot paths on the right side must match exactly across all branch definitions. You can add and remove only certain types of Helix Core branches from this view after you clone the repo. See Modifying repo configuration files safely
stream Defines a Helix Core stream that maps to the Git branch. NA Provide a stream name using the syntax //streamdepot/mystream. A Git Fusion branch can be defined as a view or a stream but not both. If your branch is defined as stream, it can include only one stream. For more information, see Working with Helix Core streams.
read-only Prohibit git pushes that introduce commits to the branch. No

Yes equivalent (Yes, On, 1, True) or No equivalent (No, Off, 0, False). Yes makes the branch read-only and prevents users from committing changes.

Sample repo configuration files

Here are two examples of repo configuration files:

Important

The Git work tree path notation on the view field's right side must match exactly for all branches defined in a repo configuration file to enable merge commits. Otherwise, Git Fusion will fail during a merge between the branches and report the error file(s) not in client view.

Example 1:

[@repo]
description = A repo configuration file that maps two branches, master and release, into the top level of the Git repo.

[master]
git-branch-name = master
view = //depot/main/your_project/... ...


[release]
git-branch-name = release
view = //depot/release/your_project/... ...

Example 2:

[@repo]
description = A repo configuration file that maps portions of two branches, master and release, into subdirectories in the Git repo
charset = utf8

[master]
git-branch-name = master
view = //depot/main/your_project/foo1/... foo1/...
       //depot/main/your_project/bar1/... bar1/...

[release]
git-branch-name = release
view = //depot/release/your_project/foo1/... foo1/...
       //depot/release/your_project/bar1/... bar1/...