Skip to content

Instantly share code, notes, and snippets.

@mintindeed
Created January 23, 2013 00:25
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mintindeed/4600385 to your computer and use it in GitHub Desktop.
Save mintindeed/4600385 to your computer and use it in GitHub Desktop.
Bash script for git pull using username and password
#!/bin/bash
path="/var/www/sites/htdocs/wp-content/themes/vip/";
git_path="https://username:password@bitbucket.org/penskemediacorp/";
git_array=( plugins pmc-variety pmc-plugins );
git_path_array=("${git_array[@]}")
git_path_array[0]=wordpress-vip-plugins;
#git_path_array[1]=pmc-variety-interim;
total=${#git_array[*]}
for (( i=0; i<=$(( $total -1 )); i++ ))
do
echo "\n$path${git_array[$i]}\n";
cd $path${git_array[$i]};
echo $git_path${git_path_array[$i]}".git";
git pull $git_path${git_path_array[$i]}".git";
done
echo -e '\n Complete';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment