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.
Request
- Base URLhttps://cpanel-server.tld:2083/execute
- AuthHTTP basic
Query parameters
The absolute directory path that contains the repository to update.
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.
The repository's new display name.
If you do not specify a value, the function does not update this parameter.
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.
Response
HTTP Request was successful.
Example response
{
"apiversion": 3,
"func": "update",
"module": "VersionControl",
"result": {
"data": {
"available_branches": [
"master"
],
"branch": "master",
"clone_urls": {
"read_only": [
"https://user@example.com/home/user/example"
],
"read_write": [
"ssh://user@example.com/home/user/example"
]
},
"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"
},
"status": 1
}
}Changes
No recorded changes to this operation across all 5 revisions of this API.