Skip to content

Instantly share code, notes, and snippets.

@anandpdoshi
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anandpdoshi/9829336 to your computer and use it in GitHub Desktop.
Save anandpdoshi/9829336 to your computer and use it in GitHub Desktop.
Git All
#!/usr/bin/env python2.7
import sys, os
import subprocess, commands
def main():
for folder in os.listdir("."):
if os.path.exists(os.path.join(folder, ".git")):
git = commands.getoutput('which git')
try:
print subprocess.check_output([git] + sys.argv[1:], cwd=os.path.abspath(folder))
except subprocess.CalledProcessError, e:
print e.output
if __name__=="__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment