Created
April 28, 2014 15:11
-
-
Save grok/11375013 to your computer and use it in GitHub Desktop.
This was an old script I wrote, I later converted to ruby: https://github.com/grok/script-update-repositories
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
#!/bin/bash | |
# This is where I want my script to start. | |
cd ~/Projects/ | |
# Let the person running the script know what's going on. | |
echo -e "\n\033[1mPulling in latest changes for all repositories...\033[0m\n" | |
# Find all directories here - that are at least 1 level down, but don't go any further than 1 directory. | |
# Go into those directories and pull the repository. | |
for i in $(find . -maxdepth 1 -mindepth 1 -type d); do | |
echo -e "\033[1m"+$i+"\033[0m"; cd $i; git remote -v; git pull; | |
cd ~/Projects/DealerTrend | |
done | |
echo -e "\n\033[1mComplete! Do work son!\033[0m\n" |
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
Once you've made your shell script executable and run it - you should see output similar to this: | |
[myuser@mycomputer:~/Projects/] $ ./updateRepositories.sh | |
Pulling in latest changes for all repositories... | |
+./sandbox+ | |
fatal: Not a git repository (or any of the parent directories): .git | |
fatal: Not a git repository (or any of the parent directories): .git | |
+./myawesomerepo+ | |
origin remoteuser@gitserver:myrepo.git (fetch) | |
origin remoteuser@gitserver:myrepo.git (push) | |
Already up-to-date. | |
+./myapplication+ | |
origin remoteuser@gitserver:myrepo.git (fetch) | |
origin remoteuser@gitserver:myrepo.git (push) | |
Already up-to-date. | |
+./wordpress-plugin-open-source+ | |
origin remoteuser@gitserver:myrepo.git (fetch) | |
origin remoteuser@gitserver:myrepo.git (push) | |
public remoteuser@gitserver:myrepo.git (fetch) | |
public remoteuser@gitserver:myrepo.git (push) | |
Already up-to-date. | |
Complete! Do work son! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment