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

P4 CLI Reference | 2025.1

# p4 repo (graph)

Create, edit, or delete a repo specification.

For depots of type `graph` only.

## Syntax

    p4 [g-opts] repo [-d | -i] [-f] reponame
    p4 repo -o reponame

Syntax conventions

## Description

An administrator is the owner, which is set in the `Owner` field of the repo specification, or a user that has been granted the `admin` permission for that specific graph depot or repo.

Such an administrator uses this command to create, edit, or delete a repo that stores files from Git users.

By default, the editor configured by the `$P4EDITOR` environment variable displays the repo specification, which you can save immediately, or after making edits.

To create a repo, you must be an admin, be the owner of the graph depot, or have the `create-repo` permission. For details about permissions, see `p4 grant-permission`.

It is a best practice when you create a repo to set the default branch. See "Specify a default branch" in the Work with Git in P4 Server Administration Documentation.

## Options

`-d reponame` | Delete the repo, including the files it contains. The name of a repo cannot be the same as the name of a branch, client workspace, or label. The P4 Server cannot retrieve a deleted repo.
`-f` | Enable any user with the `admin` privilege to force a change, such as to delete the repo or change its owner. By default, a repo can be deleted only by the owner.
`-i` | Read a repo specification from standard input.
`-o reponame` | Write a repo specification to standard output.
`g-opts` | See Global options.

## Form Fields

Field Name | Description
--- | ---
`Name:` | The name of this repo.
`Owner:` | The user who created this repo.
`Created:` | The date this specification was created.
`Pushed:` | The date of the last `push` to this repo.
`Options:` | Repo options: `[no]lfs`
`Description:` | A short description of the repo (optional).
`MirroredFrom:` | Upstream URL this read-only repo is mirrored from.
`GonnMirrorSecretToken:` | The webhook SecretToken that the `gconn --mirrorhooks add` command generates.
`GconnMirrorServerId:` | Server-Id of the git-connector that handles mirroring.
`GconnMirrorStatus:` | Status of repo mirroring through the git-connector.
`GconnMirrorExcludedBranches:` | Branch names to be excluded in mirroring.
`GconnMirrorHideFetchUrl:` | If `true`, hide the upstream url in the message to the git user.
`DefaultBranch:` | The default branch to clone (such as `refs/heads/trunk` or `trunk`). It must begin with `refs/` if git is to use it.

## Examples

To create a repo, `//graphDepot1/repo8`, within the depot of type `graph`, `graphDepot1`, that already exists:

    p4 repo //graphDepot1/repo8

To create a repo directly from the command line, without having to use the spec editor:

    p4 repo -o //graphDepot1/repo8 | p4 repo -i

To delete a repo named `//graphDepot1/repo8`:

    p4 repo -d //graphDepot1/repo8

You will be prompted to use the `-f` option to force deletion:

    p4 repo -f -d //graphDepot1/repo8

## Usage notes

Can File Arguments Use Revision Specifier? | Can File Arguments Use Revision Range? | Minimal Access Level Required
--- | --- | ---
N/A | N/A | `read` though p4 grant-permission (graph) to read and to use -o or -i. `create-repo` through p4 grant-permission (graph) to create a repo and grant permissions on any repo that user owns. `delete-repo` through p4 grant-permission (graph). admin through p4 grant-permission (graph) to create, delete, use the -f, option, and grant permissions.

## Related commands

To list the repos known to P4 Server | `p4 repos`
To list all depots known to P4 Server | `p4 depots`

Your search for returned results