Last active
December 10, 2015 16:09
-
-
Save hvnsweeting/4459472 to your computer and use it in GitHub Desktop.
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 python | |
#Today: Sat Jan 5 10:26:43 ICT 2013 | |
#by hvn | |
import subprocess as spr | |
import os | |
import tempfile | |
#TODO: multi thread / multiprocess | |
#NOTE tao truoc cac repo tren srvgit moi | |
TEMPDIR = tempfile.mkdtemp() | |
def main(): | |
reponames = ['unigate', 'vpnwebpy', 'devguide', 'openstuck', 'homepage', 'workshop'] | |
#reponames = ['unigate'] | |
oldsrv = "[email protected]" | |
newsrv = "[email protected]:hungnv/" | |
spr.call('ssh-add ~/.ssh/id_rsa', shell=True) | |
os.chdir(TEMPDIR) | |
print os.getcwd() | |
for name in reponames: | |
gitlink = oldsrv + ":" + name | |
spr.call('git clone ' + gitlink + ' && cd ' + name + | |
' && git remote add newgit ' + newsrv + name + '.git' + | |
' && git push newgit master', shell=True) | |
# don dep | |
os.chdir('..') | |
spr.call('rm -rf ' + TEMPDIR, shell=True) | |
if __name__ == "__main__": | |
m |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment