Skip to content

Instantly share code, notes, and snippets.

@kwharrigan
Created April 11, 2012 21:17
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kwharrigan/2362694 to your computer and use it in GitHub Desktop.
Save kwharrigan/2362694 to your computer and use it in GitHub Desktop.
migrate repos to gitolite from old server...
#!/bin/python
import os
repos = [''] # list of repo names here...
for repo in repos:
print repo
shortname = repo.split('.git')[0]
os.system('git clone --bare me@oldserver:/git/%s' % repo)
os.chdir(repo)
os.system('git push --all gitolite@newserver:%s' % shortname)
os.system('git push --tags gitolite@newserver:%s' % shortname)
os.chdir('..')
os.system('rm -rf %s' % repo)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment