Skip to content

Instantly share code, notes, and snippets.

@hvnsweeting
Last active December 10, 2015 16:09
Show Gist options
  • Save hvnsweeting/4459472 to your computer and use it in GitHub Desktop.
Save hvnsweeting/4459472 to your computer and use it in GitHub Desktop.
#!/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