From Gentoo Wiki
Jump to:navigation Jump to:search

This article is a stub. Please help out by expanding it - how to get started.

cgit is a fast web-interface (CGI) for git written in the C programming language. It makes it possible for potential contributors to track and view project source code from the web instead of through a git client. cgit is licensed under the GPLv2.

cgit is written and maintained by Gentoo developer Jason A. Donenfeld (zx2c4) .


USE flags

USE flags for www-apps/cgit a fast web-interface for git repositories

doc Add extra documentation (API, Javadoc, etc). It is recommended to enable per package instead of globally
highlight Enable source code highlighting
lua Enable support for Lua scripting
test Enable dependencies and/or preparations necessary to run tests (usually controlled by FEATURES=test but can be toggled independently)
vhosts Add support for installing web-based applications into a virtual-hosting environment

cgit can be managed though webapp-config if the vhosts USE flag is enabled. Without vhosts it will install into normal directories.


root #emerge --ask www-apps/cgit

After installation some post-install instructions should be visible in the output from the install command. Please read these instructions carefully before proceeding to use cgit.

Web server

cgit depends upon a web server in order to operate as intended. Fortunately several web servers are available through Portage:

After installing and configuring a web server of choice return here to continue the cgit configuration process.


Relative configuration files include:

  • /etc/cgitrc - The global configuration file. This is used to modifying settings for all users.


Update repository list automatically

If you would like to update the list of git repositories in cgit automatically consider adding something similar to the following as a cron job:

/usr/share/webapps/cgit/<version_number>/hostroot/cgi-bin/cgit.cgi --scan-tree=/git/repo-parent-path > /etc/cgit-repos
Be sure to replace <version_number> in the string above with the appropriate cgit version.

Then add include=/etc/cgit-repos into the /etc/cgitrc global configuration file. This way it is simpler and more convenient. You won't need to update your cgitrc every time you add a new repository.

See also

External resources