Get all the packages installed:
sudo yum install git-all httpd perl-Time-HiRes cgit composer highlight httpd-tools mariadb mariadb-server mod_ssl openssl pandoc patch php php-gd php-intl php-mysql php-tidy php-xcache php-xml python-markdown python-pygments
Set up the git user:
sudo /usr/sbin/groupadd git sudo /usr/sbin/useradd -c "git user account" -d /srv/git -m -g git -s /bin/bash git sudo passwd git sudo usermod -aG git apache sudo usermod -aG apache git sudo usermod -aG git git
Give http a swift restart:
sudo systemctl restart httpd
Edit the cgit repo file to use cgit repos
sudo vi /etc/cgitrc ##and included like this: include=/etc/cgitrepos ##
Create our first repo
sudo vi /etc/cgitrepos section=Erik’s Really Cool Stuff repo.url=erik.git repo.path=/srv/git/erik.git repo.desc=Erik repository repo.owner=erik@Fuck.com repo.readme=info/about.html
make the repo and set the permissions:
sudo mkdir /srv/git/erik.git/ sudo git init --bare /srv/git/erik.git sudo chmod -R 2775 /srv/git/ sudo chown -R erik.git /srv/git/
Test it
http://yourserver.com/cgit
git config –global user.name “Erik”
git config –global user.email
git init
git remote add origin 192.168.1.1:/srv/git/erik.git
git add .
git commit -m “Initial commit”
git push -u origin master
Troubleshooting:
sudo systemctl stop httpd sudo rm -f /var/cache/cgit/* sudo systemctl start httpd
