Skip to content

Instantly share code, notes, and snippets.

@ad510
Created April 25, 2012 07:17
Show Gist options
  • Save ad510/2487685 to your computer and use it in GitHub Desktop.
Save ad510/2487685 to your computer and use it in GitHub Desktop.
shell script to install Git on USC parallel computers without root permissions
# note that this file needs execute permissions to run, which can be done by running "chmod u+rwx ./install_git_on_parallel.sh" (without quotes)
# this script based on:
# http://joemaller.com/908/how-to-install-git-on-a-shared-host/
# http://stackoverflow.com/questions/9500898/compiler-error-msgfmt-command-not-found-when-compiling-git-on-a-shared-hosting
# update $PATH
echo "# the following line added by install_git_on_parallel.sh" >> ~/.bashrc
echo "export PATH=$HOME/opt/bin:$PATH" >> ~/.bashrc
. ~/.bashrc
# make temporary source directory
mkdir ~/git_src
# compile zlib
cd ~/git_src
wget http://zlib.net/zlib-1.2.6.tar.gz
tar -xvzf zlib-1.2.6.tar.gz
rm ./zlib-1.2.6.tar.gz
cd ./zlib-1.2.6
./configure --prefix=$HOME/opt
make && make install
# compile git
cd ~/git_src
wget https://git-core.googlecode.com/files/git-1.7.10.tar.gz
tar -xvzf git-1.7.10.tar.gz
rm ./git-1.7.10.tar.gz
cd ./git-1.7.10
./configure --prefix=$HOME/opt --with-zlib=$HOME/opt --without-tcltk
make -i
make install -i
# clean up source directories
cd ~
rm -rf ~/git_src/zlib-1.2.6
rm -rf ~/git_src/git-1.7.10
rmdir ~/git_src
echo "NOW LOG OUT AND LOG BACK IN, THEN YOU CAN USE GIT!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment