Update Git repository settings

This function modifies a Git™ repository's basic settings. For more information about support for version control in cPanel & WHM, read our Git Version Control and Guide to Git documentation.

Note:

  • This function only pulls changes from the remote repository if you specify a branch value.
  • You cannot modify the type, repository_root, or url values for existing repositories.
  • You must include the repository_root parameter in order to identify the repository to update.
  • All other input parameters are optional. Use them to assign the new values to the account. If you do not include a parameter or specify its existing value, no change will occur.
SecurityBasicAuth
Request
query Parameters
repository_root
required
string <path>

The absolute directory path that contains the repository to update.

Example: repository_root=/home/user/public_html/example
branch
string

The new branch to use.

If you do not specify a value, the function does not update this parameter.

Remember:

This function only pulls changes from the remote repository if you specify this value.

Example: branch=master
name
string

The repository's new display name.

If you do not specify a value, the function does not update this parameter.

Example: name=example
object

A JSON-encoded object containing information about the source repository.

If you do not specify a value, the function does not update this parameter.

Important:

  • You cannot modify the source repository's URL.
  • You must JSON-encode the contents of this object.
Example: source_repository={"remote_name":"origin"}
Responses
200

HTTP Request was successful.

Response Schema: application/json
apiversion
integer

The version of the API.

func
string

The name of the method called.

module
string

The name of the module called.

object
get/VersionControl/update
Request samples
uapi --output=jsonpretty \
  --user=username \
  VersionControl \
  update \
  repository_root='/home/user/public_html/example'
Response samples
application/json
{
  • "apiversion": 3,
  • "func": "update",
  • "module": "VersionControl",
  • "result": {
    • "data": {
      • "available_branches": [
        • "master"
        ],
      • "branch": "master",
      • "clone_urls": {},
      • "deployable": 1,
      • "last_deployment": {
        • "deployment_date": 1569844800,
        • "repository_state": {
          • "author": "User Name <user.name@example.com>",
          • "date": 1569844800,
          • "identifier": "2fd4e1c67a2d28fced849ee1bb76e7391b93eb121",
          • "message": "I'm committing some particularly cromulent code."
          }
        },
      • "last_update": {
        • "author": "Jane Doe <jane.doe@example.com>",
        • "date": 1569844800,
        • "identifier": "2fd4e1c67a2d28fced849ee1bb76e7391b93eb12",
        • "message": "I'm committing some particularly cromulent code."
        },
      • "name": "example",
      • "repository_root": "/home/user/example",
      • "tasks": [
        • {
          • "action": "create",
          • "args": {
            • "repository_root": "/home/user/example"
            },
          • "id": "00000000/5a9ec8dd4c345d",
          • "subsystem": "VersionControl"
          }
        ],
      • "type": "git"
      },
    • "errors": null,
    • "messages": null,
    • "metadata": { },
    • "status": 1,
    • "warnings": null
    }
}