cogito(7) Manual Page


cogito - version control system


cg-COMMAND <arg>…


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 (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


cg-log --help

Regular commands

cg-add FILE…
Add files to the GIT repository.
Add new branch to the GIT repository.
List configured GIT branches.
Cancels current edits in the working tree.
cg-clone [-s] LOCATION [DESTDIR]
Clone a remote GIT repository.
cg-commit [-mMESSAGE]… [-C] [-e | -E] [FILE]…
Commit into a GIT repository.
cg-diff [-c] [-m] [-p] [-r FROM_ID[:TO_ID]] [FILE]…
Make a diff between two GIT trees.
cg-export DESTFILE [TREE_ID]
Exports a particular revision from a GIT repository.
cg-help [COMMAND]
Show help for Cogito commands.
Initialize a GIT repository.
cg-log [-c] [-f] [-m] [-s] [-uUSERNAME] [-r FROM_ID[:TO_ID]] FILE…
Make a log of changes in a GIT branch.
cg-merge [-c] [-b BASE_COMMIT] BRANCH_NAME
Merge a branch to the current tree.
cg-mkpatch [-m] [-s] [-r FROM_ID[:TO_ID]]
Make a patch from one or several commits.
cg-patch [-R] < patch on stdin
Apply a diff generated by cg-diff.
cg-pull [-f] [BRANCH_NAME]
Pull changes from a remote branch to the local GIT repository.
cg-restore [FILE]…
Restore removed/changed files in the working tree.
cg-rm [-n] FILE…
Remove files from a GIT repository.
cg-seek [COMMIT_ID]
Seek the working tree to a given commit.
Show status of entries in your working tree.
Mark certain commit by a tag.
List stored GIT tags.
cg-update [-f] [BRANCH_NAME]
Pull and merge changes from a branch to the local repository.

Advanced commands

cg-admin-ls [-t TREE_ID] [PATH]
List contents of a particular tree in a GIT repository.
cg-admin-lsobj [OBJECT_TYPE]
List objects of the GIT repository.
cg-admin-uncommit [-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.

Common code shared by the Cogito toolkit.
Merge two files.
Normalize an ID to an SHA1 hash value.
Get ID of commit associated with given id or HEAD.
Get ID of parent commit to a given revision or HEAD.
Get ID of tree associated with given commit or HEAD.

Command Identifiers

Indicates a branch name added with the cg-branch-add command.
Indicates a Cogito command. The cg- prefix is optional.
Indicates a local file path or a URI. See cg-branch-add for a list of supported URI schemes.
Indicates an ID resolving to a commit. The following expressions can be used interchangably as IDs:
  • empty string, this or HEAD (current HEAD)

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

  • tag name (as registered with cg-tag)

  • date string (as recognized by the date tool)

  • shortcut object hash (shorted unambiguous hash lead)

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

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

Indicates a free form tag name.
Indicates a git object type i.e.: blob, commit, tree or tag.
Indicates a free form user name.
Indicates an already existing filename - always relative to the root of the repository.


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


Copyright © Petr Baudis, 2005.