-
-
Save alghanmi/2487716 to your computer and use it in GitHub Desktop.
shell script to install Git on USC parallel computers without root permissions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 two lines added by install_git_on_parallel.sh" >> ~/.bashrc | |
echo "export PATH=$HOME/opt/bin:$PATH" >> ~/.bashrc | |
echo ". $HOME/opt/contrib/completion/git-completion.bash" >> ~/.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 | |
# add bash completion | |
mv contrib/ $HOME/opt/ | |
# 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
Added Feature