Last active
August 29, 2015 13:57
-
-
Save anandpdoshi/9829336 to your computer and use it in GitHub Desktop.
Git All
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
#!/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