Skip to content

Instantly share code, notes, and snippets.

@fapestniegd
Created October 12, 2011 23:38
Show Gist options
  • Select an option

  • Save fapestniegd/1282963 to your computer and use it in GitHub Desktop.

Select an option

Save fapestniegd/1282963 to your computer and use it in GitHub Desktop.
def mirror(git_dir, remote):
returncode = subprocess.call(
args=[
'git',
'--git-dir=%s' % git_dir,
'push',
'--mirror',
remote,
],
cwd=git_dir,
close_fds=True
)
if returncode != 0:
raise GitPushMirrorException('exit status %d' % returncode)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment