Gitweb Git Web Interface

Gitweb Web Interface For Git

Git comes with two graphical user interface (GUI) tools. The portable graphical interface to Git git-gui is used to commit repository changes. The git repository browser gitk is used to browse or display changes in a repository.

Both git-gui and gitk focus on single repositories. Change to the folder containing a git repository in order to use either gitk or git-gui (git gui from command line). Gitweb allows browsing of all repositories.

This tutorial uses Git for source code management. Git is cross-platform compatible (Unix, Linux, MacOS and Windows). Git can be downloaded from

    Tools are required:

  • Text editor (preferable command line).
  • Secure Shell (SSH) Client.
  • Shell Access (command line).
  • Web Server.
  • Git.
  • Gitweb.

Optional Installing Git

Git install instructions are available at Git Source Code Management.

Setting Up Gitweb

# Install Gitweb #
sudo apt-get install gitweb
# Optional Move Repository Folder #
mv /path-to-myRespositories /var/cache/git
# Optional Symlink Repository Folder #
ln -s /path-to-myRespositories /var/cache/git

Install Gitweb. The default folder for Gitweb Git repositories is “/var/cache/git”. Current repositories can be moved or symlinked to the default Gitweb Git folder.

Optional Apache Password Protect Gitweb

# Assuming Apache Web Server Installed #
	nano /etc/apache2/conf.d/gitweb
		Alias /gitweb /usr/share/gitweb
		<Directory /usr/share/gitweb>
			Options FollowSymLinks +ExecCGI
			AddHandler cgi-script .cgi
			<IfModule mod_authn_file.c>
				AuthType Basic
				AuthName "'s personal Git Repositories"
				AuthUserFile /path-to-password-folder/.htpasswd
			Require valid-user
# Restart Apache #
service apache2 restart

For security, a password will be required for Gitweb. Apache will need to be restarted in order for the changes to propagate. More information about password protecting folders using Apache is available at Apache Password Protect.

Demonstration: Gitweb Git Web Interface Tutorial

Image Missing Gitweb Authentication Required

Image Missing Gitweb Show All Repositories

Image Missing Gitweb Show Single Repository


Git comes with Graphic User Interfaces for browsing individual Git repositories. Gitweb allows Git repository browsing using a web browser. Gitweb must be setup manually.

Gitweb allows browsing of multiple repositories. Security can be implemented for the webserver to allow only specific individuals to browse the Git repositories.


  1. Use password protection for web browsing.
  2. Link Git repositories to the default Gitweb folder.