Skip to content

Instantly share code, notes, and snippets.

@erlang
Created January 12, 2010 08:57
Show Gist options
  • Save erlang/275033 to your computer and use it in GitHub Desktop.
Save erlang/275033 to your computer and use it in GitHub Desktop.
#!/usr/bin/perl -w
use strict;
my $range = "";
$range = shift if @ARGV;
foreach (`git log --oneline --first-parent $range`) {
next unless /^([\da-f]+) Merge branch '([^\']*)'/;
print "git branch -f $2 $1^2\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment