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

P4 Server Administration Documentation | 2025.1

# Specify a default branch

If your project uses a name other than `master` (such as main) as the default branch name, make sure to specify this name in the `DefaultBranch` field of the repo spec as a full Git ref, such as `refs/heads/main`. Otherwise, if this field is left blank, the Git Connector assumes that your default branch to clone is `master`, the current default name, according to https://git-scm.com/docs/git-init in the year 2025. This would mean that you need to:

- Add the branch name to the Git command every time you push to, clone, or check out the branch.
- Manually check out the branch after you clone it.

To make your work easier, specify a default branch. For example, to make `main` the default branch, add the following line to the repo spec:

    $ DefaultBranch: refs/heads/main

Setting the `DefaultBranch` field in the repo spec simplifies pushing and cloning branches.

In addition, you can push:

- a single branch by specifying the branch name, which creates a repo with only that branch:

      $ git push git@ConnectorHost:graphDepotName/repoName branchName

- all branches by passing in the `--all` option, which creates a repo with all branches:

      $ git push git@ConnectorHost:graphDepotName/repoName --all

- all branches and Git tags by passing in the `"*:*"` option, which creates a repo with all branches and Git tags.

      $ git push git@ConnectorHost:graphDepotName/repoName "*:*"

Your search for returned results