SYNOPSIS

cg-COMMAND <arg>…

DESCRIPTION

Cogito is a version control system layered on top of the git tree history storage system. Amongst some of the noteworthy features, Cogito has support for branching, tagging and multiple backends for distributing repositories (local files, rsync, HTTP, ssh).

Cogito is implemented as a series of bash(1) scripts on top of git(7) (a content-tracking filesystem) with the goal of providing an interface for working with the GIT database in a manner similar to other SCM tools (like CVS, BitKeeper or Monotone).

Commands Overview

The Cogito commands can be split into regular commands and advanced commands. The regular commands are those used for normal interacting with the repository, while the advanced commands can be used for administrating the repository and should to some degree be regarded as low-level and in some cases dangerous.

Below an overview of the available commands are listed. For details on individual commands, do e.g.

cg-help cg-log

or

cg-log --long-help

You can find the quick overview of the most useful commands and concepts in cg-ref(7).

Regular commands

cg-add(1) [-a] [-N] [-r] FILE…

Add new files to the repository

cg-branch-add(1) BRANCH_NAME LOCATION

Add new remote branch

cg-branch-chg(1) BRANCH_NAME NEW_LOCATION

Change an existing remote branch repository URL

cg-branch-ls(1)

List configured remote branches

cg-clean(1) [-d] [-D] [-n] [-q] [-x]

Remove untracked files from the working tree

cg-clone(1) [-l] [-b] [-s] LOCATION [DESTDIR]

Clone a remote repository

cg-commit(1) [-m MESSAGE]… [-e] [-c COMMIT_ID] [OTHER_OPTIONS] [FILE]… [< MESSAGE]

Commit changes in the working tree to the repository

cg-diff(1) [-c] [-m] [-s] [-p] [-r FROM_ID[..TO_ID]] [FILE]…

Show changes in the diff format

cg-export(1) [-r TREE_ID] DESTFILE

Export contents of a particular revision

cg-fetch(1) [-f] [-v] [BRANCH_NAME]

Fetch changes from a remote branch to the local repository

cg-help(1) [-c] [cg-COMMAND | COMMAND]

Show help for Cogito commands

cg-init(1) [-I] [-N] [-e EXCLUDEPATTERN]… [-m MESSAGE]…

Initialize new repository

cg-log(1) [-D DATE] [-r FROM_ID[..TO_ID]] [-d] [-s | --summary] [OTHER_OPTIONS] [FILE]…

Show the list of changes

cg-merge(1) [-n] [-b BASE_COMMIT] [-j] [--squash] [-v] [BRANCH_NAME]

Merge a branch to the current branch

cg-mkpatch(1) [-m] [-s] [-r FROM_ID[..TO_ID] [-d DIRNAME]]

Create a patch from a commit or a series of commits

cg-mv(1) [-f] FILE… DEST

Rename or move files in the repository

cg-object-id(1) [-b | -c | -d | -n | -p | -t] [OBJECT_ID]

Get the SHA1 id of an object associated with the given symbolic id

cg-patch(1) [-c] [-C COMMIT] [-pN] [-R] [-m | -d DIR] [OTHER_OPTIONS] < PATCH

Apply a patch from a file, standard input, or a commit

cg-push(1) [-f] [-r LOCAL_BRANCH] [-t TAG]… [REMOTE_BRANCH]…

Push changes to a remote repository

cg-reset(1) [--adds-removes]

Reset the state of the working tree

cg-restore(1) [-f] [-r ID] [FILE]…

Restore files in the working tree to the given state

cg-rm(1) [-a] [-f] [-n] [-r] FILE…

Remove files from the repository

cg-seek(1) [COMMIT_ID]

Seek the working tree to a given commit

cg-status(1) [-g] [[-n] -s STATUS] [-w] [-x] [DIRPATH]

Show status of the repository and your working tree

cg-switch(1) [-f] [-l | -n | -p] [-o REMBRANCH] [-c | -r COMMIT_ID] BRANCH

Switch the working tree to a different (or new) local branch

cg-tag(1) [-m MESSAGE]… [-e] [-s] [OTHER_OPTIONS] TAG_NAME [OBJECT_ID]

Mark certain commit with a tag

cg-tag-ls(1)

List existing tags

cg-tag-show(1) TAGNAME…

Show information about given tag(s)

cg-update(1) [-f] [--squash] [-v] [BRANCH_NAME]

Fetch and merge changes from a remote repository

cg-version(1) [--lib-dir] [--share-dir]

Show the version of the Cogito toolkit

cg-version.in(1) [--lib-dir] [--share-dir]

Show the version of the Cogito toolkit

Advanced commands

cg-admin-cat(1) [-r TREE_ID] FILE…

Cat file(s) by filename from given tree or revision

cg-admin-ls(1) [-r TREE_ID] [PATH]

List contents of a particular tree in the repository

cg-admin-rewritehist(1) [-d TEMPDIR] [-r STARTREV]… [-k KEEPREV]… [FILTERS] DESTBRANCH

Rewrite revision history

cg-admin-setuprepo(1) [-g GROUP] REPOSITORY

Setup a public repository

cg-admin-uncommit(1) [-t] [COMMIT_ID]

Undo a commit or a series of commits

Helper commands

There are a few helper commands that are not meant to be used from the command line. They provide a library of generic functions used by many of the real Cogito commands. You can safely ignore them, unless you want to contribute to Cogito development.

cg-Xfetchprogress

Show a cute progressbar for cg-fetch

cg-Xfollowrenames

git-rev-list | git-diff-tree --stdin following renames

cg-Xlib

Common code shared by the Cogito toolkit

cg-Xmergefile

Merge two revisions of a file

Command Identifiers

BRANCH_NAME

Indicates a branch name added with the cg-branch-add(1) or cg-switch(1) commands.

COMMAND

Indicates a Cogito command. The cg- prefix is optional.

LOCATION

Indicates a local file path or a URI. See cg-branch-add(1) for a list of supported URI schemes.

COMMIT_ID, FROM_ID, TO_ID, BASE_COMMIT

Indicates an ID resolving to a commit. The following expressions can be used interchangeably as IDs:

  • empty string, this or HEAD (current HEAD)

  • branch name (as registered with cg-branch-add(1))

  • tag name (as registered with cg-tag(1))

  • date string (as recognized by the date tool)

  • shortcut object hash (shorted unambiguous hash lead)

  • commit object hash (as returned by cg-object-id -c)

  • tree object hash (as returned by cg-object-id -t)

TAG_NAME

Indicates a free form tag name.

OBJECT_TYPE

Indicates a git object type i.e.: blob, commit, tree or tag.

USERNAME

Indicates a free form user name.

FILE

Indicates an already existing filename - always relative to the root of the repository.

FILES

~/.cgrc

This file is read on startup if stdout is a terminal and may contain information about default command line options. Each line consists of a command name and a list of options. Lines not starting with a Cogito command name are ignored. To have cg-log and cg-diff colorize the output put the following in ~/.cgrc:

log -c
diff -c
You can prevent Cogito from reading ~/.cgrc by setting the
CG_NORC environment variable.

COPYRIGHT

Copyright © Petr Baudis, 2005.

SEE ALSO

Cogito is based on git(7). A quick Cogito reference sheet is in cg-ref(7). Cogito homepage is at http://git.or.cz/cogito.