C. Command-Line Reference
   
C. Command-Line Reference
This chapter provides a detailed description of the CLI (Command Line Interface) commands available to GitCentric users. Although they can be used interactively, these commands are intended to be used in administrative scripts.
Basic Syntax
The GitCentric CLI commands are executed as SSH remote commands, which require that you have an SSH client installed. The syntax for a GitCentric CLI command executed from SSH is:
ssh -p <port> <user>@<host> gitcentric [<command>] [[<arg>]...]] [--help] [--]
where:
<port> is the GitCentric port number, typically 29418.
<user>@<host> is the SSH user account used with GitCentric (for example myusername@localhost).
<command> may be one of the following:
config-branch
config-repo
delete-repo
ls-repo
<arg> is one or more arguments to pass to <command>. These vary based on command.
--help, -h displays the on-line help for the current command. Note: Specifying --help with no other arguments (for example, gitcentric --help) returns a list of all available sub-commands.
-- specifies that the rest of the command line is to be considered arguments, not options. For example, if you need to pass a repo name that starts with "-" you would precede it with "--". Note that after using "--", you cannot pass any further options on that command line.
...config-repo Repo1 Repo2 -- -Repo3 Repo4 -Repo5
Spaces and Quoting
You must use quotes to include a space in arguments for a GitCentric SSH command.
In addition, Windows requires that you nest single quotes within double-quotes. In the example below, highlighted in bold, double-quotes are provided for the Windows shell, and single-quotes are nested within the double-quotes for the SSH command-line parser.
C:\source\TestProject>ssh -p 29418 mylogin@localhost gitcentric
config-branch --branch refs/heads/master -p 1 -e 3 -s 2
-d "'xxxx yyyy'" --initialSync git TestProject