Skip to content

Instantly share code, notes, and snippets.

@sabman
Created February 12, 2010 09:07
Show Gist options
  • Save sabman/302427 to your computer and use it in GitHub Desktop.
Save sabman/302427 to your computer and use it in GitHub Desktop.
git clone from behind a proxy
#!/bin/bash
repo_url=$1
read -s -p "Enter Password: " password
echo "Saving original proxy ... "
orig_proxy=$HTTP_PROXY
echo "getting username: $USERNAME"
echo "seeding the proxy with sweet love ..."
echo -ne '##### (33%)\r'
sleep 1
echo -ne '############# (66%)\r'
sleep 1
echo -ne '####################### (100%)\r'
echo -ne '\n'
HTTP_PROXY=`echo -n $HTTP_PROXY | sed -e "s/http:\/\/\(.*\)/http:\/\/$USERNAME:$password@\1/"`
git clone $1
#removing the love from the proxy
HTTP_PROXY=$orig_proxy
echo $HTTP_PROXY
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment