Skip to content

Instantly share code, notes, and snippets.

@pjf
Created November 8, 2014 22:55
Show Gist options
  • Save pjf/28679ae79cb343ccb524 to your computer and use it in GitHub Desktop.
Save pjf/28679ae79cb343ccb524 to your computer and use it in GitHub Desktop.
#!/usr/bin/perl
use 5.010;
use strict;
use warnings;
use autodie qw(:all);
use IPC::System::Simple qw(capturex systemx);
my $upstream = $ARGV[0] || "pjf";
my $branch = capturex(qw(git rev-parse --abbrev-ref HEAD));
chomp $branch;
systemx(qw(git push --set-upstream), $upstream, $branch);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment