Benutzer-Werkzeuge

Webseiten-Werkzeuge


tachtler:git_centos_7_-_gitweb

Dies ist eine alte Version des Dokuments!


Git CentOS 7 - GitWeb

Git ist ein freies auf Open-Source basierendes Versionskontrollsystem, entwickelt um kleine bis sehr große Projekte, schnell und effizient verwalten zu können.

Mit Git ab der Version 1.4.0 wird standardmäßig GitWeb ausgeliefert. GitWeb ist eine simple webbasierte CGI-Skript, welches zur Visualisierung von Git-Repositorys zum Einsatz kommen kann.

Beschreibung Externer Link
Homepage https://git.wiki.kernel.org/index.php/Gitweb

Ab hier werden root-Rechte zur Ausführung der nachfolgenden Befehle benötigt. Um der Benutzer root zu werden, geben Sie bitte nachfolgenden Befehl ein:

$ su -
Password: 

Voraussetzungen

Als Voraussetzung für die hier, nachfolgend dargestellte Installation von Git sind folgende Komponenten erforderlich:

  • Lauffähiges Git :!: WICHTIG :!: - Alle nachfolgenden Beschreibungen bauen auf folgende Installation von Git auf:

Installation

Die Installation kann aus den Standard CentOS-Repositorys erfolgen und wird mit nachfolgendem Befehl durchgeführt:

# yum install gitweb
Loaded plugins: changelog, priorities
base                                                    | 3.6 kB     00:00     
epel                                                    | 4.4 kB     00:00     
extras                                                  | 3.4 kB     00:00     
updates                                                 | 3.4 kB     00:00     
65 packages excluded due to repository priority protections
Resolving Dependencies
--> Running transaction check
---> Package gitweb.noarch 0:1.8.3.1-4.el7 will be installed
--> Finished Dependency Resolution

Changes in packages about to be updated:


Dependencies Resolved

===============================================================================
 Package         Arch            Version                   Repository     Size
===============================================================================
Installing:
 gitweb          noarch          1.8.3.1-4.el7             base          109 k

Transaction Summary
===============================================================================
Install  1 Package

Total download size: 109 k
Installed size: 320 k
Is this ok [y/d/N]: y
Downloading packages:
gitweb-1.8.3.1-4.el7.noarch.rpm                           | 109 kB   00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : gitweb-1.8.3.1-4.el7.noarch                                 1/1 
  Verifying  : gitweb-1.8.3.1-4.el7.noarch                                 1/1 

Installed:
  gitweb.noarch 0:1.8.3.1-4.el7                                                

Complete!

Mit nachfolgendem Befehl kann überprüft werden, welche Inhalte mit den Paket git installiert wurden.

# rpm -qil gitweb
Name        : gitweb
Version     : 1.8.3.1
Release     : 4.el7
Architecture: noarch
Install Date: Fri 07 Aug 2015 09:40:30 AM CEST
Group       : Development/Tools
Size        : 327778
License     : GPLv2
Signature   : RSA/SHA256, Fri 04 Jul 2014 03:33:03 AM CEST, Key ID 24c6a8a7f4a80eb5
Source RPM  : git-1.8.3.1-4.el7.src.rpm
Build Date  : Tue 10 Jun 2014 10:40:28 AM CEST
Build Host  : worker1.bsys.centos.org
Relocations : (not relocatable)
Packager    : CentOS BuildSystem <http://bugs.centos.org>
Vendor      : CentOS
URL         : http://git-scm.com/
Summary     : Simple web interface to git repositories
Description :
Simple web interface to track changes in git repositories
/etc/gitweb.conf
/etc/httpd/conf.d/git.conf
/usr/share/doc/gitweb-1.8.3.1
/usr/share/doc/gitweb-1.8.3.1/INSTALL
/usr/share/doc/gitweb-1.8.3.1/README
/var/www/git
/var/www/git/gitweb.cgi
/var/www/git/static
/var/www/git/static/git-favicon.png
/var/www/git/static/git-logo.png
/var/www/git/static/gitweb.css
/var/www/git/static/gitweb.js

Konfiguration

Nachfolgende Konfigurationsdateien sind für den Einsatz von GitWeb erforderlich:

  • /etc/gitweb.conf - Hauptkonfigurationsdatei
  • /etc/httpd/conf.d/git.conf - Konfigurationsdatei für den Apache HTTP Server

/etc/gitweb.conf

Nachfolgende Anpassungen sind für den Betrieb mindestens erforderlich:

Relevante Änderungen sind mit einem vorangestellten Kommentar, welcher wie nachfolgend dargestellt aussieht, gekennzeichnet:

# Tachtler

(Komplette Konfigurationsdatei):

# The gitweb config file is a fragment of perl code. You can set variables
# using "our $variable = value"; text from "#" character until the end of a
# line is ignored. See perlsyn(1) man page for details.
#
# See /usr/share/doc/gitweb-*/README and /usr/share/doc/gitweb-*/INSTALL for
# more details and available configuration variables.
 
# Set the path to git projects.  This is an absolute filesystem path which will
# be prepended to the project path.
# Tachtler
# default: #our $projectroot = "/var/lib/git";
our $projectroot = "/srv/git";
 
# Set the list of git base URLs used for URL to where fetch project from, i.e.
# the full URL is "$git_base_url/$project". By default this is empty
# Tachtler
# default: #our @git_base_url_list = qw(git://git.example.com
# default: #                            ssh://git.example.com/var/lib/git);
our @git_base_url_list = qw(http://git.tachtler.net
                            https://git.tachtler.net);
 
# Enable the 'blame' blob view, showing the last commit that modified
# each line in the file. This can be very CPU-intensive. Disabled by default
#$feature{'blame'}{'default'} = [1];
#
# Allow projects to override the default setting via git config file.
# Example: gitweb.blame = 0|1;
#$feature{'blame'}{'override'} = 1;
 
# Disable the 'snapshot' link, providing a compressed archive of any tree. This
# can potentially generate high traffic if you have large project. Enabled for
# .tar.gz snapshots by default.
#
# Value is a list of formats defined in %known_snapshot_formats that you wish
# to offer.
#$feature{'snapshot'}{'default'} = [];
#
# Allow projects to override the default setting via git config file.
# Example: gitweb.snapshot = tbz2,zip; (use "none" to disable)
#$feature{'snapshot'}{'override'} = 1;
 
# Disable grep search, which will list the files in currently selected tree
# containing the given string. This can be potentially CPU-intensive, of
# course. Enabled by default.
#$feature{'grep'}{'default'} = [0];
#
# Allow projects to override the default setting via git config file.
# Example: gitweb.grep = 0|1;
#$feature{'grep'}{'override'} = 1;
 
# Disable the pickaxe search, which will list the commits that modified a given
# string in a file. This can be practical and quite faster alternative to
# 'blame', but still potentially CPU-intensive. Enabled by default.
#$feature{'pickaxe'}{'default'} = [0];
#
# Allow projects to override the default setting via git config file.
# Example: gitweb.pickaxe = 0|1;
#$feature{'pickaxe'}{'override'} = 1;

Erklärungen zu den Konfigurationsdateiänderungen:

# Set the path to git projects.  This is an absolute filesystem path which will
# be prepended to the project path.
# Tachtler
# default: #our $projectroot = "/var/lib/git";
our $projectroot = "/srv/git";
 
# Set the list of git base URLs used for URL to where fetch project from, i.e.
# the full URL is "$git_base_url/$project". By default this is empty
# Tachtler
# default: #our @git_base_url_list = qw(git://git.example.com
# default: #                            ssh://git.example.com/var/lib/git);
our @git_base_url_list = qw(http://git.tachtler.net);
  • our $projectroot = "/srv/git";

Setzen des Verzeichnispfades zu dem Speicherort, an dem die Git-Repositorys im Dateisystem abgelegt sind.

  • our @git_base_url_list = qw(http://git.tachtler.net
                                https://git.tachtler.net);

Setzen der Basis-URLs, unter denen die Git-Repositorys erreichbar sind.

/etc/httpd/conf.d/git.conf

Die mit der Installation von GitWeb mitgelieferte Konfigurationsdatei

  • /etc/httpd/conf.d/git.conf

soll nachfolgend nicht zum Einsatz kommen.

Die nötigen Konfigurationen des Apache HTTP Server sollen in einem VHOST erfolgen, wie unter nachfolgenden internen Links bereits beschrieben.

:!: FIXME Hier geht es weiter… / To be continued…

Diese Website verwendet Cookies. Durch die Nutzung der Website stimmen Sie dem Speichern von Cookies auf Ihrem Computer zu. Außerdem bestätigen Sie, dass Sie unsere Datenschutzbestimmungen gelesen und verstanden haben. Wenn Sie nicht einverstanden sind, verlassen Sie die Website.Weitere Information
tachtler/git_centos_7_-_gitweb.1438942240.txt.gz · Zuletzt geändert: 2015/08/07 12:10 von klaus