---
name: "cogito"
section: "7"
platform: "linux"
package: "cogito"
version: "0.18.2-1"
release: "Debian 4.0 (Etch)"
platforms: ["linux"]
url: "https://new.carta.tech/cogito"
---

# cogito(7)

version control system

## NAME

cogito - version control system

## SYNOPSIS

cg-COMMAND \<arg\>....sp

## 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)..sp *Cogito* is implemented as a series of *[bash(1)](/bash/1.md)* scripts on top of [**git**(7)](/git/7.md) (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*)..sp

## 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..sp Below an overview of the available commands are listed. For details on individual commands, do e.g..sp

```
cg-help cg-log
```

or.sp

```
cg-log --long-help
```

You can find the quick overview of the most useful commands and concepts in [**cg-ref**(7)](/cg-ref/7.md)..sp

### Regular commands

[**cg-add**(1)](/cg-add/1.md) \[-a\] \[-N\] \[-r\] FILE...

Add new files to the repository

[**cg-branch-add**(1)](/cg-branch-add/1.md) BRANCH\_NAME LOCATION

Add new remote branch

[**cg-branch-chg**(1)](/cg-branch-chg/1.md) BRANCH\_NAME NEW\_LOCATION

Change an existing remote branch repository URL

[**cg-branch-ls**(1)](/cg-branch-ls/1.md)

List configured remote branches

[**cg-clean**(1)](/cg-clean/1.md) \[-d\] \[-D\] \[-n\] \[-q\] \[-x\]

Remove untracked files from the working tree

[**cg-clone**(1)](/cg-clone/1.md) \[-l\] \[-b\] \[-s\] LOCATION \[DESTDIR\]

Clone a remote repository

[**cg-commit**(1)](/cg-commit/1.md) \[-m MESSAGE\]... \[-e\] \[-c COMMIT\_ID\] \[OTHER\_OPTIONS\] \[FILE\]... \[\< MESSAGE\]

Commit changes in the working tree to the repository

[**cg-diff**(1)](/cg-diff/1.md) \[-c\] \[-m\] \[-s\] \[-p\] \[-r FROM\_ID\[..TO\_ID\]\] \[FILE\]...

Show changes in the diff format

[**cg-export**(1)](/cg-export/1.md) \[-r TREE\_ID\] DESTFILE

Export contents of a particular revision

[**cg-fetch**(1)](/cg-fetch/1.md) \[-f\] \[-v\] \[BRANCH\_NAME\]

Fetch changes from a remote branch to the local repository

[**cg-help**(1)](/cg-help/1.md) \[-c\] \[cg-COMMAND \| COMMAND\]

Show help for Cogito commands

[**cg-init**(1)](/cg-init/1.md) \[-I\] \[-N\] \[-e EXCLUDEPATTERN\]... \[-m MESSAGE\]...

Initialize new repository

[**cg-log**(1)](/cg-log/1.md) \[-D DATE\] \[-r FROM\_ID\[..TO\_ID\]\] \[-d\] \[-s \| --summary\] \[OTHER\_OPTIONS\] \[FILE\]...

Show the list of changes

[**cg-merge**(1)](/cg-merge/1.md) \[-n\] \[-b BASE\_COMMIT\] \[-j\] \[--squash\] \[-v\] \[BRANCH\_NAME\]

Merge a branch to the current branch

[**cg-mkpatch**(1)](/cg-mkpatch/1.md) \[-m\] \[-s\] \[-r FROM\_ID\[..TO\_ID\] \[-d DIRNAME\]\]

Create a patch from a commit or a series of commits

[**cg-mv**(1)](/cg-mv/1.md) \[-f\] FILE... DEST

Rename or move files in the repository

[**cg-object-id**(1)](/cg-object-id/1.md) \[-b \| -c \| -d \| -n \| -p \| -t\] \[OBJECT\_ID\]

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

[**cg-patch**(1)](/cg-patch/1.md) \[-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)](/cg-push/1.md) \[-r LOCAL\_BRANCH\] \[-t TAG\]... \[REMOTE\_BRANCH\]...

Push changes to a remote repository

[**cg-reset**(1)](/cg-reset/1.md) \[--adds-removes\]

Reset the state of the working tree

[**cg-restore**(1)](/cg-restore/1.md) \[-f\] \[-r ID\] \[FILE\]...

Restore files in the working tree to the given state

[**cg-rm**(1)](/cg-rm/1.md) \[-a\] \[-f\] \[-n\] \[-r\] FILE...

Remove files from the repository

[**cg-seek**(1)](/cg-seek/1.md) \[COMMIT\_ID\]

Seek the working tree to a given commit

[**cg-status**(1)](/cg-status/1.md) \[-g\] \[\[-n\] -s STATUS\] \[-w\] \[-x\] \[DIRPATH\]

Show status of the repository and your working tree

[**cg-switch**(1)](/cg-switch/1.md) \[-f\] \[-l \| -n \| -p\] \[-c \| -r COMMIT\_ID\] BRANCH

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

[**cg-tag**(1)](/cg-tag/1.md) \[-m MESSAGE\]... \[-e\] \[-s\] \[OTHER\_OPTIONS\] TAG\_NAME \[OBJECT\_ID\]

Mark certain commit with a tag

[**cg-tag-ls**(1)](/cg-tag-ls/1.md)

List existing tags

[**cg-tag-show**(1)](/cg-tag-show/1.md) TAGNAME...

Show information about given tag(s)

[**cg-update**(1)](/cg-update/1.md) \[-f\] \[--squash\] \[-v\] \[BRANCH\_NAME\]

Fetch and merge changes from a remote repository

[**cg-version**(1)](/cg-version/1.md) \[--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)](/cg-admin-cat/1.md) \[-r TREE\_ID\] FILE...

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

[**cg-admin-ls**(1)](/cg-admin-ls/1.md) \[-t TREE\_ID\] \[PATH\]

List contents of a particular tree in the repository

[**cg-admin-lsobj**(1)](/cg-admin-lsobj/1.md) \[OBJECT\_TYPE\]

List unpacked objects in the repository

[**cg-admin-rewritehist**(1)](/cg-admin-rewritehist/1.md) \[-d TEMPDIR\] \[-r STARTREV\]... \[-k KEEPREV\]... \[FILTERS\] DESTBRANCH

Rewrite revision history

[**cg-admin-setuprepo**(1)](/cg-admin-setuprepo/1.md) \[-g GROUP\] REPOSITORY

Setup a public repository

[**cg-admin-uncommit**(1)](/cg-admin-uncommit/1.md) \[-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..sp

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)](/cg-branch-add/1.md) or [**cg-switch**(1)](/cg-switch/1.md) 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)](/cg-branch-add/1.md) 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)](/cg-branch-add/1.md))

- •

  tag name (as registered with [**cg-tag**(1)](/cg-tag/1.md))

- •

  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..sp

## SEE ALSO

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