Skip to content

2. Available Commands

Mark Hamstra edited this page May 15, 2015 · 14 revisions

When you have Gitify installed, you can use Gitify list to get an overview of all available commands, and Gitify help [command] to get more information about that specific command.

Gitify version 0.8.0

Usage:
 [options] command [arguments]

Options:
 --help (-h)           Display this help message.
 --verbose (-v|vv|vvv) Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug.
 --version (-V)        Display the Gitify version.

Available commands:
 backup            Creates a quick backup of the entire MODX database. Runs automatically when using `Gitify build --force`, but can also be used manually.
 build             Builds a MODX site from the files and configuration.
 extract           Extracts data from the MODX site, and stores it in human readable files for editing and committing to a VCS.
 help              Displays help for a command
 init              Generates the .gitify file to set up a new Gitify project. Optionally installs MODX as well.
 list              Lists commands
 restore           Restores the MODX database from a database dump created by `Gitify backup`
install
 install:modx      [Deprecated, will be removed in v1] Downloads, configures and installs a fresh MODX installation. 
 install:package   [Deprecated, will be removed in v1] Downloads and installs MODX packages. 
modx
 modx:install      Downloads, configures and installs a fresh MODX installation. [Note: install:modx will be removed in 1.0, use modx:install instead]
package
 package:install   Downloads and installs MODX packages. [Note: install:package will be removed in 1.0, use package:install instead]

Gitify build

Used to read the data files, and write them to the MODX database. Note that this reads the .gitify file to see what needs to be built; it doesn't blindly try to write any file it encounters.

As of v0.9, Gitify build automatically cleans up any orphaned objects it encounters. An orphaned object is an object that exists in the database, but not in the gitify files. This works on both resources and other objects. Before v0.9, you had to use the --force attribute to ensure the database matched the files exactly.

Also as of v0.9, Gitify build automatically tries to resolve duplicate id/primary key conflicts for both content and other objects. Whenever it finds an object of which the real primary key (typically the ID) already exists, it will temporarily keep that object in memory. After completing the rest of the build, including the orphans clean up, it will attempt to resolve the conflict. In the case of a moved or renamed object/resource, the orphan clean up will have removed the "old" object by then, in which case the object will be inserted normally. If there is a genuine conflict (perhaps two developers added a new resource or object in separate branches), it will insert the object with a new auto incremented ID. It will also execute a Gitify extract in that case.

Usage:
 build [--skip-clear-cache] [-f|--force] [--no-backup]

Options:
 --skip-clear-cache    When specified, it will skip clearing the cache after building.
 --force (-f)          When specified, all existing content will be removed before rebuilding. Can be useful when having dealt with complex conflicts.
 --no-backup           When using the --force attribute, Gitify will automatically create a full database backup first. Specify --no-backup to skip creating the backup, at your own risk.
 --help (-h)           Display this help message.
 --verbose (-v|vv|vvv) Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug.
 --version (-V)        Display the Gitify version.

Gitify extract

Used to read stuff from the MODX database, and turn it into majestic YAML data files.

Usage:
 extract

Options:
 --help (-h)           Display this help message.
 --verbose (-v|vv|vvv) Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug.
 --version (-V)        Display the Gitify version.

Gitify init

Used to create a .gitify file in the current directory. Interactively allows you to set up a basic configuration, and also prompts to install MODX if it's not yet present.

Usage:
 init [--overwrite]

Options:
 --overwrite           When a .gitify file already exists, and this flag is set, it will be overwritten.
 --help (-h)           Display this help message.
 --verbose (-v|vv|vvv) Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug.
 --version (-V)        Display the Gitify version.

Gitify modx:install

Renamed from Gitify install:modx in v0.8. Installs the latest version of MODX, or the one you specified, by downloading the zip and running a command line install. Database details and the likes will be asked for interactively.

Usage:
 modx:install [modx_version]

Arguments:
 modx_version          The version of MODX to install, in the format 2.3.2-pl. Leave empty or specify "latest" to install the last stable release.

Options:
 --help (-h)           Display this help message.
 --verbose (-v|vv|vvv) Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug.
 --version (-V)        Display the Gitify version.

Gitify package:install

Renamed from Gitify install:package in v0.8. Installs the last version of a MODX Package with the PackageName you specified, or all packages defined in your .gitify file when specifying the --all flag.

Usage:
 package:install [--all] [-i|--interactive] [package_name]

Arguments:
 PackageName          The MODX Package to install. Installs the last stable release of the Package.

Options:
 --all                 When specified, all packages defined in the .gitify config will be installed.
 --interactive (-i)    When --all and --interactive are specified, all packages defined in the .gitify config will be installed interactively. Installing a single package is always done interactively. 
 --help (-h)           Display this help message.
 --verbose (-v|vv|vvv) Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug.
 --version (-V)        Display the Gitify version.

Gitify backup

Added in 0.7. Creates a backup of your full MySQL database. The backup will be written to the directory specified by the backup_directory option in your .gitify file.

Usage:
 backup [name]

Arguments:
 name                  Optionally the name of the backup file, useful for milestone backups. If not specified the file name will be a full timestamp.

Options:
 --help (-h)           Display this help message.
 --verbose (-v|vv|vvv) Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug.
 --version (-V)        Display the Gitify version.

Gitify restore

Added in 0.7. Restores your MySQL database from a backup created with Gitify backup. Specify "last" to use the most recent backup.

Usage:
 restore [file]

Arguments:
 file                  The file name of the backup to restore; if left empty you will be provided a list of available backups. Specify "last" to use the last backup, based on the file modification time.

Options:
 --help (-h)           Display this help message.
 --verbose (-v|vv|vvv) Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug.
 --version (-V)        Display the Gitify version.

Clone this wiki locally