Skip to content

Instantly share code, notes, and snippets.

@besi
Created March 17, 2011 08:13
Show Gist options
  • Save besi/873995 to your computer and use it in GitHub Desktop.
Save besi/873995 to your computer and use it in GitHub Desktop.
Goes through a list of paths and performs a git pull
#!/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')
}
@besi
Copy link
Author

besi commented Mar 22, 2011

Usage

You may open this script in Textmate and simply hit CMD + R to execute it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment