cogito(7)
=========

NAME
----
cogito - version control system

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 gitlink: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
gitlink:cg-ref[7].

Regular commands
~~~~~~~~~~~~~~~~


gitlink:cg-add[]  [-N] [-r] FILE...::
	Add files to the GIT repository.

gitlink:cg-branch-add[]  BRANCH_NAME LOCATION::
	Add new remote branch to the GIT repository.

gitlink:cg-branch-chg[]  BRANCH_NAME NEW_LOCATION::
	Change the remote branch repository URL.

gitlink:cg-branch-ls[] ::
	List configured remote branches.

gitlink:cg-clean[]  [-d] [-D] [-n] [-q] [-x]::
	Clean unknown files from the working tree.

gitlink:cg-clone[]  [-l] [-s] LOCATION [DESTDIR]::
	Clone a remote GIT repository.

gitlink:cg-commit[]  [-m MESSAGE]... [-e] [-c COMMIT_ID] [OTHER_OPTIONS] [FILE]... [< MESSAGE]::
	Commit into a GIT repository.

gitlink:cg-diff[]  [-c] [-m] [-s] [-p] [-r FROM_ID[..TO_ID]] [FILE]...::
	Make a diff between two GIT trees.

gitlink:cg-export[]  [-r TREE_ID] DESTFILE::
	Export a particular revision from a GIT repository.

gitlink:cg-fetch[]  [-f] [-v] [BRANCH_NAME]::
	Fetch changes from a remote branch to the local GIT repository.

gitlink:cg-help[]  [-c] [cg-COMMAND | COMMAND]::
	Show help for Cogito commands.

gitlink:cg-init[]  [-I] [-N] [-e EXCLUDEPATTERN]... [-m MESSAGE]...::
	Initialize a GIT repository.

gitlink:cg-log[]  [-D DATE] [-r FROM_ID[..TO_ID]] [-s] [--summary] [OTHER_OPTIONS] FILE...::
	Make a log of changes in a GIT branch.

gitlink:cg-merge[]  [-c] [-b BASE_COMMIT] [-j] [--squash] [-v] [BRANCH_NAME]::
	Merge a branch to the current tree.

gitlink:cg-mkpatch[]  [-m] [-s] [-r FROM_ID[..TO_ID] [-d DIRNAME]]::
	Make a patch from one or several commits.

gitlink:cg-mv[]  [-f] FILE... DEST::
	Rename or move files in a GIT repository.

gitlink:cg-object-id[]  [-c | -d | -n | -p | -t] [OBJECT_ID]::
	Get SHA1 ID of commit or tree associated with given ID or HEAD.

gitlink:cg-patch[]  [-c] [-C COMMIT] [-pN] [-R] [-u] [OTHER_OPTIONS] < PATCH::
	Apply a patch from a file, input, or a commit.

gitlink:cg-push[]  [-r LOCAL_BRANCH] [REMOTE_BRANCH] [-t TAG]...::
	Push changes to a remote GIT repository.

gitlink:cg-reset[]  [--adds-removes]::
	Reset the state of the working tree.

gitlink:cg-restore[]  [-f] [-r ID] [FILE]...::
	Restore files in the working tree to state at the given/last commit.

gitlink:cg-rm[]  [-f] [-n] [-r] FILE...::
	Remove files from a GIT repository.

gitlink:cg-seek[]  [COMMIT_ID]::
	Seek the working tree to a given commit.

gitlink:cg-status[]  [-g] [[-n] -s STATUS] [-w] [-x] [DIRPATH]::
	Show status of your working tree.

gitlink:cg-switch[]  [-f] [-n] [-r COMMIT_ID] BRANCH::
	Switch your current local branch.

gitlink:cg-tag[]  [-d DESCRIPTION] [-s [-k KEYNAME]] TAG_NAME [OBJECT_ID]::
	Mark certain commit by a tag.

gitlink:cg-tag-ls[] ::
	List stored GIT tags.

gitlink:cg-update[]  [-f] [--squash] [-v] [BRANCH_NAME]::
	Pull and merge changes from a remote branch to the local repository.

gitlink:cg-version.in[] ::
	Show the version of the Cogito toolkit.

Advanced commands
~~~~~~~~~~~~~~~~~


gitlink:cg-admin-cat[]  [-r TREE_ID] FILE...::
	Cat a file(s) by filename from a GIT repository.

gitlink:cg-admin-ls[]  [-t TREE_ID] [PATH]::
	List contents of a particular tree in a GIT repository.

gitlink:cg-admin-lsobj[]  [OBJECT_TYPE]::
	List objects of the GIT repository.

gitlink:cg-admin-rewritehist[]  [-d TEMPDIR] [-r STARTREV]... [FILTERS] DESTBRANCH::
	Rewrite GIT revision history.

gitlink:cg-admin-setuprepo[]  [-g GROUP] DIRECTORY::
	Setup a public GIT repository.

gitlink: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.


cg-Xfetchprogress::
	Show a cute progressbar for cg-fetch.

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 gitlink:cg-branch-add[1] or
	gitlink:cg-switch[1] commands.

COMMAND::
	Indicates a 'Cogito' command. The `cg-` prefix is optional.

LOCATION::
	Indicates a local file path or a URI. See gitlink: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 gitlink:cg-branch-add[1])
	- tag name (as registered with gitlink: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 (C) Petr Baudis, 2005.

SEE ALSO
--------
Cogito is based on gitlink:git[7]. A quick Cogito reference sheet is in
gitlink:cg-ref[7].
