Installing Cgit on CentOS 7

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
Facebooktwittergoogle_plusredditpinterestlinkedinmailby feather

Git

Client (make sure git is installed)

mkdir git

cd git

git config --global user.name "Erik" 

git config --global user.email your@email.net

ssh-copy-id 123.123.123.123

git clone ansible:/srv/git/erik.git

cd git/erik

ls

PUSH CHANGES

git add * 

git status

git commit -m "Comment" 

git push origin master

PULL CHANGES

cd into directory

git pull localhost:/srv/git/roles.git

###Disk Info

##Adding Disk Space

sudo pvcreate /dev/sdc
sudo vgextend centos_katello /dev/sdc
sudo lvextend -L 49G /dev/centos_katello/var_lib_mongodb
sudo lvresize -r /dev/centos_katello/var_lib_mongodb -L 49G

#fstab example

echo "###############################################################"
echo "# Add this to /etc/fstab: #"
echo "# #NFS Shares #"
echo "# 172.16.4.20:/Backup /home/erik nfs auto 0 0 #"
echo "# 172.16.4.20:/share /mnt/share nfs auto 0 0 #"
echo "###############################################################"

###Notes:

exec ssh-agent bash

ssh-add 

ssh 123.123.123.123
Facebooktwittergoogle_plusredditpinterestlinkedinmailby feather