For this tutorial, we will use a Windows 8 64bit machine as our client computer, and a CentOS CPanel server computer.
You can get the Git client from http://git-scm.com/
If you have already started the process of installing Git on the CPanel server, you might cause a problem with Perl as installing Git from the repos can cause conflicts with Perl. Git is already installed on CPanel servers, so no installation is necessary. But, configuration is necessary as it is not yet user friendly for setting up your own repositories.
1) setup GIT and git user on server
sudo adduser git
(you can add your SSH certificate if you want)
cat /tmp/id_rsa.EXAMPLE.pub >> ~/.ssh/authorized_keys
– OR –
(you can make a password for the git user)
2) setup repository for project and grant git user ownership
chown -R git ./EXAMPLE.git
git --bare init
3) remove git .bashrc and modify root .bashrc files
mv ./.bashrc ./.bashrc_old
(add this line to the root .bashrc file)
(save and quit using :wq in VIM)
The git server and project are setup, you can now commit or pull your files!
[optional] initiate git repo on project folder and commit
git commit -a -m "initial commit"
git remote add origin git@SERVERIP:/opt/git/EXAMPLE.git
git push origin master
– OR –
[optional] transfer project files from remote server computer to client computer
Create folder on your client PC, right click in folder and click “GIT Bash”.
git clone git@SERVERIP:/opt/git/EXAMPLE.git