Skip to content

Instantly share code, notes, and snippets.

@welly
Created March 10, 2015 06:35
Show Gist options
  • Select an option

  • Save welly/ac1073c61c6cc7b852bc to your computer and use it in GitHub Desktop.

Select an option

Save welly/ac1073c61c6cc7b852bc to your computer and use it in GitHub Desktop.
Loops through a bunch of sites, git init, git add, git commit, git push to remote repo
#!/bin/bash
while read p; do
if [ -d "/home/$p" ]; then
echo $p
if [ -d "/home/$p/public_html" ]; then
cd /home/$p/public_html
git init
git add .
git commit -am "first commit"
git remote add origin ssh://git@gitlab.captovate.com.au:2223/client/$p
git push -u origin master
fi
fi
done < sites.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment