Created
March 17, 2011 08:13
-
-
Save besi/873995 to your computer and use it in GitHub Desktop.
Goes through a list of paths and performs a git pull
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
#!/usr/bin/env ruby | |
# List of git-enabled projects | |
repos = [ | |
"~/Projects/ProjectA", | |
"~/Projects/ProjectB", | |
] | |
line = "\n" + "*" * 50 | |
thinLine = "\n" + '-' * 50 | |
puts "Pulling #{repos.length} repositories" | |
repos.each {|dir| | |
puts ( "\n\n#{line} \n #{dir} #{line}") | |
# CD to the directory and perform a pull | |
system ('cd ' + dir + ' && git pull') | |
# Show local changes | |
puts thinLine | |
system ('cd ' + dir + ' && git status --short') | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage
You may open this script in Textmate and simply hit CMD + R to execute it