Skip to content

Instantly share code, notes, and snippets.

@dinomite
Created December 21, 2010 15:12
Show Gist options
  • Save dinomite/750030 to your computer and use it in GitHub Desktop.
Save dinomite/750030 to your computer and use it in GitHub Desktop.
Stash local changes before doing `git svn rebase`
#!/usr/bin/env perl
# Drew Stephens <[email protected]>
# 2010-12-17
#
# Stash local changes before doing `git svn rebase`
use strict;
use warnings;
my $applyStash = 0;
my $stashName = "gsrebase " . `date`;
my $stash = `git stash save $stashName`;
chomp $stash;
if ($stash ne 'No local changes to save') {
print "Stashing local uncommited changes\n";
$applyStash = 1;
}
system('git svn rebase');
if ($applyStash == 1) {
print "Applying stash of local uncommited changes\n";
system('git stash pop');
}
@askedrelic
Copy link

When I do this with git pull, I like to call this a dirty pull!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment