Created
March 10, 2015 06:35
-
-
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
This file contains hidden or 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
| #!/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