Link a server folder to a GitHub repository
git_linkConnect a folder on the user's server to a GitHub repository: a deploy key is made on the server (for the folder's owner) and added to the repository, then: a folder already under git gets the remote; a missing or empty folder gets a clone; a folder with a site and an EMPTY repository is imported as its first commit (with a .gitignore for Magento, WordPress or Laravel that keeps env.php, wp-config.php, media, caches, logs and dumps out; a background job, follow it with job_output); a folder with a site and a repository that has code is attached without changing any live file, so git_status shows the differences. write true lets the server push (git_push). Needs the user's admin rights on the repository and open changes on the server.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| why | No | ||
| path | Yes | The folder's absolute path on the server, like /home/shop/public_html. | |
| repo | Yes | ||
| write | No | ||
| branch | No | ||
| server | No | Server name or id. Optional when the account has one server. | |
| message | No | First commit message for an import. | |
| approval_id | No |