Shared Hosting supports git push, but why we will remain happy with a minimal feature! You can add a Web Interface to Git on Shared Hosting. We Can Use Git Repo In Shared Hosting Account, right? We know What is Jailed Shell, right? After knowing so much, if we do not use the features then where the deployment of learning will go! Actually there are lot of options for adding a Web Interface to Git Repository which includes high end Github Enterprise software (you pay the fees for installing on your server), Gitlab ( poor man’s Gihhub Enterprise – Free Software ) to very simple web interface.
Options for Adding a Web Interface to Git Repository on Shared Hosting
Unfortunately, although Ruby is supported by cPanels, it is actually gets complicated if we use Ruby base software to add a web interface to our Git. We actually have to control the stuffs with .htaccess
file! PHP is always running, what is the problem of using PHP? Nothing. Except that, you can not use more modern PHP Git Interface, you have to limit your wishes within few features. Actually you can do a bit customization with Twitter Bootstrap to make it looking better.
Add a Web Interface to Git Repository on Shared Hosting
You need to understand few important points. First is that, this method is great if you are using a SSL certificate for kind of Organization’s project, in that case, you’ll create a subdirectory on the domain’s FTP root from cPanel’s File Manager. If the directory’s name is repository
and domain’s name is freehealthfoundation.org
then the Public URL is becoming :
---
1 | https://freehealthfoundation.org/repository/ |
Keep the name in lower case and you must create proper .htaccess
files for controlling public access to FTP or Git contents circumventing your wish.
We will use :
1 | http://www.gitphp.org/ |
First, login via SSH :
1 2 3 4 5 6 7 8 9 10 11 12 13 | ~ ssh -p 2222 tcwmedia@140.258.189.20 # if you are login for the first time # or deleted the entry from known hosts file The authenticity of host '[140.258.189.20]:2222 ([192.254.189.28]:2222)' can't be established. RSA key fingerprint is bb:6a:51:b4:63:e8:3b:a1:c9:c8:29:3f:b9:1b:4e:49. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '[140.258.189.20]:2222' (RSA) to the list of known hosts. tcwmedia@192.254.189.28's password: # we have lodged in, do a pwd tcwmedia@freehealthfoundation.org [~]# pwd /home3/tcwmedia # this is maximum the upper level you can access tcwmedia@freehealthfoundation.org [~]# cd ~ |
Now go to that directory on command line; the $PATH can be :
1 | /home3/tcwmedia/repository |
You should check by placing a plain HTML file and loading it on browser. We can not install any Git Web Interface with existing repositories – may be there are softwares, but the rule is to start with bare repo :
1 | http://schacon.github.io/git/user-manual.html#public-repositories |
So, init the bare repo, taking that you are in the repository on command line :
1 | git init --bare /home3/tcwmedia/repository/mybareproject.git |
wget the software :
1 | https://github.com/xiphux/gitphp/releases/download/0.2.9.1/gitphp-0.2.9.1.tar.gz |
Untar it :
1 2 3 4 5 6 7 8 | tar -xzvf gitphp* cd gitphp* # move all to one level up mv * .. cd .. pwd && ls # delete the tar file rm -r gitphp* |
Install normally after moving the files to root as written there.
Tagged With git web gui for free , Gitphp Project Gitphp 0 2 9 1 datasheet manual