tags:

views:

514

answers:

3

At work, development doesn't have revision control. By this I mean that we are only allowed to check into the P4 depot when the change set is ready for regression testing. We can't check in intercolary changes! There are a host of problems with having no revision control during development that I don't need to go into here. Instead, I brought the problem to prodsys and they said, "no, but what you do in your home directory is your business". Basically, I can install it myself if I want it.

Unfortunately, I can't install it myself, because I'm on CentOS 5 at work and I don't have root. Yum won't give you the time of day if you don't have root. So what can I do to get git? I'm fine with statically linked binary if that makes it easy, but I can't find such a thing anywhere. I'm also looking for git-p4.

Edit: I've downloaded the tarball but I think I'm missing deps. I've read through the INSTALL doc and opted out of every optional dependency:

make prefix=$HOME/git NO_TCLTK=YesPlease NO_OPENSSL=YesPlease  NO_CURL=YesPlease  NO_EXPAT=YesPlease

But I still can't build.

I get this error:

: command not foundline 2:
: command not foundline 5:
: command not foundline 8:
./GIT-VERSION-GEN: line 14: syntax error near unexpected token `elif'
'/GIT-VERSION-GEN: line 14: `elif test -d .git -o -f .git &&

and it builds a lot of .o's until I get to:

...
LINK git-daemon
make: *** No rule to make target `GIT-VERSION-FILE', needed by `git-am'.  Stop.`

And I'm stuck again.

A: 

www.git-scm.org

Or you could download the RPMs yourself, and extract them like so:

rpm2cpio git-1.7.0.5.i386.rpm |cpio -iv 

and copy it into ~username/bin/git and run it from there.

Chris Kaminski
Would this actually work? Git builds in the path to all of its commands (`libexec/git-core/git-*`), so you can't take an installation built to be placed in `/usr/local` and place it somewhere else without setting GIT_EXEC_PATH, I don't think...
Jefromi
Ah, I think I misremembered. From the makefile: "gitexecdir, template_dir, mandir, infodir, htmldir, ETC_GITCONFIG can be specified as a relative path...and 'git' at runtime figures out where they are based on the path to the executable" - and the default values are indeed relative paths. This feature was added in git v1.6.2, which is much newer than CentOS 5's native version, but as long as you're getting a new rpm, you should be fine.
Jefromi
I don't know what this is doing, but I tried it verbatim anyway and it didn't work. cpio: ./usr/libexec/git-core/git: No such file or directorycpio: ./usr/libexec/git-core/git-remote-http: No such file or directorycpio: ./usr/libexec/git-core/git-remote-ftps: No such file or directorycpio: ./usr/libexec/git-core/git-remote-ftp: No such file or directory etc
masonk
+1  A: 

Chris Kaminski already linked to the git site (though the true url is http://git-scm.com/). There's a download link for a tarball there. You can also clone the git.git repo:

 git clone git://git.kernel.org/pub/scm/git/git.git

 git clone http://www.kernel.org/pub/scm/git/git.git   # if behind a firewall

Either way, all you'll have to do is make install - the default prefix is $HOME, placing files in $HOME/bin, $HOME/libexec, and so on. If you want to keep it partitioned (a good idea, since there's no uninstall rule), just use the prefix option, e.g. make prefix=$HOME/git.

Jefromi
A: 

This is probably an obvious question but... "Can't you just ask your sysadmin to install git"?

Often the sysadmin will be happier to do that than have you install it with make, because at least then he'll be aware of pending security errata etc. (esp. so for something like git which speaks over the network).

James Antill