View Full Version : HOWTO: install Git on Hostmonster
marli03
11-12-2008, 11:10 AM
Git is an open source version control system and this is how I installed Git v1.6.0.4 on my hostmonster account.
$ mkdir git
$ cd git
$ wget http://kernel.org/pub/software/scm/git/git-1.6.0.4.tar.gz
$ gunzip git-1.6.0.4.tar.gz
$ tar -xf git-1.6.0.4.tar
$ cd git-1.6.0.4/
$ ./configure --prefix=$HOME/git
$ make && make install
# you can remove the source, but I chose to move it into a source folder
$ cd ~/git
$ mv git-1.6.0.4/ src/
# now add this line to your .bashrc file:
export PATH=$HOME/git/bin/:$HOME/git/lib/libexec/git-core/:$PATH
# to check your install and reload bash:
$ source ~/.bashrc
$ git --version
# to get started move to your project directory and type: (note the "." on line 3)
$ git init
# Initialized empty Git repository in /home/mysite/rails/bpc/.git/
$ git add .
That should get you started. There are lots of tutorials out there to get you on your way.
capslock118
11-12-2008, 09:30 PM
Wow,
It is amazing that you posted this today as I had just started to do research on this exact subject...today!
Thank you for the how-to, it worked wonderfully.
capslock118
11-13-2008, 06:02 PM
marli03,
Have you had any issues with connection time outs and unable to connect a socket when trying to download something using git?
I have tried two different git hosts and both had failed
marli03
11-17-2008, 10:48 AM
marli03,
Have you had any issues with connection time outs and unable to connect a socket when trying to download something using git?
I have tried two different git hosts and both had failed
I'm very new to git and haven't tried downloading anything yet. I think I saw another post about someone having problems downloading with git though. If I have a similar problem in the future and figure out a solution I'll try to post it in this thread though.
use :
git clone http://github.com/rails/rails.git
( with http:// protocol, instead of using git:// protocol )
dont use: git clone git://github.com/rails/rails.git
bye luca
PHLAK
03-17-2009, 08:09 PM
Don't know if anyone's watching this thread anymore, but when I try to pull from or push to a repository it's asking for my password and not accepting anything I give it. I added my SSH keys to the server, and tried using a few different users/password combinations, what am I doing wrong?
shadmego
03-17-2009, 09:42 PM
I don't know if this will help you, but the only ssh account information that will work is your main account. The same info you use to log into your CPanel.
If you have tried that, I'm at a loss.
~regards
PHLAK
03-18-2009, 01:11 AM
Maybe I wasn't clear. I've tried changing my 'user.email' to the user name I use to log into CPanel, and it keeps bringing up my global email address to use to log in. I've tried changing my global email address, and still it's trying to log in with the old global 'user.email'.
atoms
03-18-2009, 01:47 PM
Wow - I'm glad this got posted here since I was in a bit of a quandary about what to do for SCM.
Marli03's instructions worked perfectly for me, but note that GIT is in active development so by the time you read this, the latest stable version will probably be different. I just installed 1.6.2.1.
To get the latest stable version, find out what that version number is by peeping:
http://git-scm.com/.
Then substitute that number for whatever number you see in Marli03's otherwise excellent instructions.
PHLAK
04-05-2009, 03:35 AM
ok, got everything working up to the clone. When I issue the command to clone a repo it asks for my password then the next thing it does is give me the following error:
fatal: git upload-pack: aborting due to possible repository corruption on the remote side.
Any idea what I need to do here?
wagner_fsoares
04-29-2009, 08:30 AM
this git that you're talking about is a git server?
Could I do something like
git clone http://mydns.com/a-folder/a-project.git
?
please I need some more details, cause I'm actually using SVN through SSH and everything is working normally (checkout, commit, add/remove users).
Can I add users to the git repository?
Can I change his permissions?
Can I commit a changes?
thanks!
atoms
04-29-2009, 02:13 PM
One of the ideas from SVN/CVS/whatever that you need to shed is the idea of a "server".
Every clone of a git repository is a full fledged repository in and of itself.
Now if you host a clone on Hostmonster you (probably?) won't be able to access it via the git protocol, but that is due to Hostmonster's configuration, not due to your particular clone and its abilities.
So don't try to fetch anything like
clone git://whatever
but
clone http://whatever works.
I'm just learning git myself. I can't help with your user admin questions.
kingNothing42
07-10-2009, 09:25 PM
I've followed these directions with both the specified version and the latest version.
For some reason, it fails for me on the make && make install command. I get something that ends like this:
Generating catalog po/sv.msg
msgfmt --statistics --tcl po/sv.po -l sv -d po/
208 translated messages, 2 untranslated messages.
SUBDIR perl
make[2]: true: Command not found
make[2]: *** [blibdirs] Error 127
make[1]: *** [all] Error 2
make: *** [all] Error 2
If anyone has any insight as to what I am doing wrong or what prerequisites I am missing, that would be great
thanks
-k42
nerdrew
07-11-2009, 10:12 PM
I have run into the same problem as above while building git 1.6.3.3. Any ideas?
nerdrew
07-12-2009, 04:30 AM
Instead of:
make && make install
try:
make SHELL="/bin/bash"
make SHELL="/bin/bash" install
kingNothing42
07-17-2009, 10:14 AM
Worked like a charm! Thanks
markgard
09-14-2009, 04:25 PM
Everything has worked so far. Thanks for all the work others have put into this. Adding the SHELL="/bin/bash" to get past the first obstacle. The second problem I have now is during the make phase I get the following error.
CC transport.o
In file included from transport.c:5:
http.h:6:23: error: curl/curl.h: No such file or directory
http.h:7:23: error: curl/easy.h: No such file or directory
In file included from transport.c:5:
http.h:46: error: expected specifier-qualifier-list before 'CURLcode'
http.h:52: error: expected specifier-qualifier-list before 'CURL'
http.h:98: error: 'CURL_ERROR_SIZE' undeclared here (not in a function)
http.h: In function 'missing__target':
http.h:103: error: 'CURLE_FILE_COULDNT_READ_FILE' undeclared (first use in this function)
http.h:103: error: (Each undeclared identifier is reported only once
http.h:103: error: for each function it appears in.)
http.h:105: error: 'CURLE_HTTP_NOT_FOUND' undeclared (first use in this function)
http.h:107: error: 'CURLE_FTP_COULDNT_RETR_FILE' undeclared (first use in this function)
http.h: At top level:
http.h:180: error: expected specifier-qualifier-list before 'CURLcode'
make: *** [transport.o] Error 1
Hello,
I am not able to get Git cloning/pushing working via HTTP protocol. Because I need to protect my files via .htaccess file (deny from all) so nobody can enter git repo address to the browser and view my private (git-versioned) files.
But in this case, I can not use http:// scheme in address (HTTP 403 Forbidden) and need to use SSH address like this:
ssh://user@domain.com/~/gitrepo/reponame.git
And thats not very nice.
Is there some way how to make address to Git repo both nice and secure (with access via SSH)? Since hostmonster does not allow using git:// scheme, I would appreciate this at least:
http://git.domain.com/reponame.git
Thank you.
blakeredfield
05-26-2010, 08:38 AM
Got git 1.7.1 installed and have tested it locally thoroughly. Now I want to install gitosis to get multiple users to access my repo. However the clone fails:
# git clone http://eagain.net/gitosis.git
Initialized empty Git repository in /home1/olympiap/src/gitosis/.git/
fatal: http://eagain.net/gitosis.git/info/refs not found: did you run git update-server-info on the server?
And yes, I tried git clone git:// but that doesnt work either. And of course I tried running git update-server-info ....
At a loss as to how to proceed. Thought of grabbing gitosis and ftp-ing it over, but dont know how to grab the whole distribution as a directory, or something.
I tried SVN but abandoned it although it installed correctly (finally), but setup was a pain.
blakeredfield
05-27-2010, 02:55 AM
I got gitosis installed by ftp. I had to ftp python install tools and build them locally also. I can post directions if anyone wants, but you'll still run into trouble in the next step.
Gitosis requires that you create a user called 'git' which only has control and visibility of your git repository. From there, ssh handles with public keys allow multiple developers to access your git repository, under the protection of the 'git' user. Thus they cannot see the rest of the filesystem, run commands etc.
The problem is that hostmonster doesnt allow the creation of other users - fair enough. But there must be another way.
I've been thinking of linking my /gitrepos/ projects to /public_html/website.com/git/ and using .htaccess to control incomming users. There's a guide for someone that apparently got it working but not me:
http://www.mobiphil.com/2010/03/git-on-shared-hosting-with-git-http-backend/
Anyone interested in getting this working?
How are other people here using git on hostmonster, with multiple developers?
damainman
07-28-2010, 07:21 PM
Hello,
I apologize in advance for such a simple question but if I installed GIT following the instructions on the original post.. how would I go about upgrading GIT to new versions that are released in the future?
Thank you in advance.
damainman, because all the file are isolated in your $HOME/git directory (that's what setting --prefix=$HOME/git in ./configure does), you can upgrade git by removing everything in $HOME/git and following the steps again with the latest version.
e.g.
$ cd git
$ rm -rf *
$ wget http://kernel.org/pub/software/scm/git/git-<new-version>.tar.gz
$ tar -xzf git-<new-version>.tar.gz
$ cd git-<new-version>/
$ ./configure --prefix=$HOME/git
$ make && make install
Just be careful with the rm -rf *. It removes everything in your current directory, so make sure you're in the git directory first!
p.s. You don't need to repeat the steps with the .bashrc as long as you install the new git version in the same place ($HOME/git)
panel123
09-17-2010, 10:32 AM
thanks for the tips...
now i know how to install .. tyvm....:D
Hi All,
Thank you for the help you've given here so far. Very helpful. For those that have gotten this working, I am still a bit confused. Perhaps you could shed some light?
I have installed git successfully and now am looking to set up a clone on my local machine. When I try to do that, this is what I get:
d@d:~/[folder]$ git clone surfoped@surfopedia.org:~/var/git/alpine
Initialized empty Git repository in [folder]/.git/
surfoped@surfopedia.org's password:
bash: git-upload-pack: command not found
fatal: The remote end hung up unexpectedly
Reading through the thread I have tried http:// version as well as the command which also gives an error:
d@d:[folder]$ git clone -u /usr/bin/git-upload-pack surfoped@surfopedia.org:~/var/git/alpineInitialized empty Git repository in [folder]/.git/
surfoped@surfopedia.org's password:
bash: /usr/bin/git-upload-pack: No such file or directory
fatal: The remote end hung up unexpectedly
Strange because
d@d:$ ls -l /usr/bin/git-upload*
-rwxr-xr-x 1 root root 989624 2010-04-12 09:33 /usr/bin/git-upload-archive
-rwxr-xr-x 1 root root 384884 2010-04-12 09:33 /usr/bin/git-upload-pack
Lastly, I'm not sure this has anything to do with it, but when I search for the path in bash this is what a I get:
d@d:$ ssh surfoped@surfopedia.org echo \$PATH
surfoped@surfopedia.org's password:
/usr/bin:/bin
This is what is on .bashrc on the hostmonster server:
export PATH=$HOME/git/bin/:$HOME/git/lib/libexec/git-core/:$PATH
export PATH=$PATH:/home1/surfopedia/git/bin
Any help on getting clone working would be much appreciated. Thanks.
AlexKru
10-16-2010, 03:05 AM
Hi!
I decide this problem so:
make empty git-repo on local machine
$ mkdir test
$ cd test/
$ git init
$ Initialized empty Git repository in [path]/test/.git/
Then edit config file in [path]/test/.git/
$ gedit [path]/test/.git/config
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = ssh://login@yourhost.net/path/to/repo/
uploadpack=/full/path/to/git/bin/git-upload-pack
receivepack=/full/path/to/git/bin/git-receive-pack
[branch "master"]
remote = origin
merge = refs/heads/master
save the file, then go to local repo folder and pull
$ cd [path]/test/
$ git pull
now you have working copy:)
yes, this method is non-standart, but its work:)
P.S. sorry by my english:)
loopduplicate
05-10-2011, 10:17 PM
go here to learn what the latest version is: http://www.kernel.org/pub/software/scm/git/?C=M;O=D
example code:
ssh username@yourserver.com
mkdir git
cd git
wget http://www.kernel.org/pub/software/scm/git/git-1.7.5.tar.gz
tar -xzf git-1.7.5.tar.gz
cd git-1.7.5/
./configure --prefix=$HOME/git
make SHELL="/bin/bash"
make SHELL="/bin/bash" install
cd
nano .bashrc
# add following line to .bashrc, uncommented
# export PATH=$HOME/git/bin/:$HOME/git/libexec/git-core/:$PATH
# to check your install and reload bash
source ~/.bashrc
git --version
# now, to create a repo that you can push updates to
mkdir myremotegitfolder
cd myremotegitfolder
git init --bare --shared
exit
# you should now be logged in to your local computer, not hostmonster
# cd to the directory on your local git server
cd ~/public_html/mylocalgitfolder
git remote add hostmonster ssh://username@yourserver.com/~username/myremotegitfolder
gedit .git/config
# Now, edit the hostmonster section of .git/config so it looks like this:
[remote "hostmonster"]
url = ssh://username@yourserver.com/~username/myremotegitfolder
fetch = +refs/heads/*:refs/remotes/hostmonster/*
uploadpack=$HOME/git/bin/git-upload-pack
receivepack=$HOME/git/bin/git-receive-pack
# save .git/config and return to the terminal window
# now you can push your local repo to hostmonster!
git push hostmonster master
# after the first push, use just git push hostmonster (without master)
emmyc
06-27-2011, 08:51 PM
but when I try to checkout the code, I got an error message says:
bash:git-upload-pack:command not found
fatal: The remote end hung up unexpectedly.
I am using XCODE 4
shenglu
10-17-2011, 07:56 PM
Each clone of a Git repository itself is a complete and mature repository. Now, if your host Hostmonster clone (possible?) Will not be able to access through the Git protocol, but because of the configuration of Hostmonster, but not because of your particular clone and its capabilities.
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.