Git Plugin

Allows the management of a git repository

Example:

ctl:
  plugins:

    - name: git_ctl
      type: git
      config:
        # we want to manage the ctl github repo
        repo_url: git@github.com:20c/ctl


  permissions:
    - namespace: ctl
      permission: crud

When you first run ctl after a new git plugin has been configured, it will automatically clone it to the ctl tmp directory ~/.ctl/tmp. Depending on your ssh key you may be asked for a passphrase.

This plugin is mostly used in combination with other plugins and seldomly by itself. For a more complex example of other plugins making use of the git plugin check the quickstart examples.

The plugin will expose three operations to the ctl cli:

  1. clone (happens automatically on first init)
  2. pull (pull remote)
  3. checkout (checkout a tag or branch)

Operations like commit and push are also available but are not exposed to the ctl cli at this point. However other plugins may use them.

Usage

Plugin name

This usage documentation assumes that the plugin instance name is git

usage: ctl git [-h] [--branch BRANCH] [--checkout-path CHECKOUT_PATH]
               {clone,pull,checkout} ...

optional arguments:
  -h, --help            show this help message and exit
  --branch BRANCH       Checkout this branch (master)
  --checkout-path CHECKOUT_PATH
                        checkout to this local location - if not specified
                        will default to ~/.ctl/cache/{repo_url} ()

Operation:
  {clone,pull,checkout}
    clone               clone repo
    pull                pull remote
    checkout            checkout tag or branch