GitPHP

A web based git repository browser written in PHP

Project List

Project List Methods

There are several ways to populate the list of projects in GitPHP.

Directory List

If you do not create the config file config/projects.conf.php or do not put any settings in it, by default GitPHP will list out all projects it can find in the project root. Projects will be categorized in GitPHP by directory by default, unless the category is overridden (see Project Settings below).

If you set the exportedonly config flag, the list will only show projects that have been exported to the git daemon with the git-daemon-export-ok special file.

Array

In config/projects.conf.php, you can set the $git_projects variable to an array of projects, and only these projects will be displayed. These are project paths relative to the project root.

$git_projects = array(
  'gentoo.git',
  'php/gitphp.git',
  'core/fbx.git'
);

File List

In config/projects.conf.php, you can set the $git_projects variable to the path to a list of projects.

$git_projects = '/git/projectlist.txt';

This file contains a list of project paths relative to the projectroot, with each optionally followed by a space and an owner. The format is the standard Gitweb project list format, which can also be exported by apps like Gitosis and Gitolite.

gentoo.git Chris Han
php/gitphp.git Chris Han
core/fbx.git

SCM-Manager Config

In config.projects.conf.php, you can set the $git_projects variable to the path to an SCM-Manager repository config file. This is usually named repositories.xml, and resides in your SCM-Manager config directory in your home directory. GitPHP will only display git projects marked as public in SCM-Manager.

$git_projects = '~/.scm/config/repositories.xml';

Project Settings

Several GitPHP settings can be overridden on a per-project basis. There are couple different ways to set these per-project settings.

Per-Project Settings

The following settings are unique to per-project settings:

Additionally, the following global settings can be overridden on a per-project level:

Project Config File

In config/projects.conf.php, the variable $git_projects_settings can be set with per-project settings. Each key in this variable is the project path relative to the project root, ad the value is an array of settings mapped to values.

$git_projects_settings['php/gitphp.git'] = array(
  'category' => 'PHP',
  'description' => 'GitPHP, a web-based git repository browser in PHP',
  'owner' => 'Chris Han',
  'cloneurl' => 'http://git.gitphp.org/gitphp.git',
  'pushurl' => '',
  'bugpattern' => '/#([0-9]+)/',
  'bugurl' => 'http://www.gitphp.org/issues/${1}',
  'compat' => false,
  'website' => 'http://www.gitphp.org',
  'allowedusers' => array(
    'user1',
    'user2'
  )
);

$git_projects_settings['gentoo.git'] = array(
  'description' => 'Gentoo portage overlay',
  'compat' => true
);

Git Config

Config values can also be set in the project’s git config itself. This is the ‘config’ file inside your git repository, or it can be accessed using the ‘git config’ command.

In the config, the section is [gitphp], and the key is the setting. Your config file could have a section like this:

[gitphp]
    category = PHP
    description = GitPHP, a web-based git repository browser in PHP
    owner = Chris Han
    cloneurl = http://git.gitphp.org/gitphp.git
    pushurl = 
    bugpattern = "/#([0-9]+)/"
    bugurl = http://www.gitphp.org/issues/${1}
    compat = false
    website = http://www.gitphp.org
    allowedusers = user1
    allowedusers = user2

Or, by setting individual config keys using git-config on the command line:

git --git-dir=/git/project.git config gitphp.category PHP