Skip to content

Instantly share code, notes, and snippets.

@sheepmaster
Created November 4, 2011 13:42
Show Gist options
  • Select an option

  • Save sheepmaster/1339342 to your computer and use it in GitHub Desktop.

Select an option

Save sheepmaster/1339342 to your computer and use it in GitHub Desktop.
#!/usr/bin/perl
use strict;
use warnings;
my $mirror_branch = '__mirror';
for (<>) {
chomp;
my ($old, $new, $branch) = split / /;
if ($branch eq "refs/remotes/$mirror_branch") {
system(qw[git --work-tree=.. checkout], $new);
last;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment