Add a git_push_force rule

This commit is contained in:
mcarton
2015-07-20 18:20:29 +02:00
parent ee87d1c547
commit 569709388d
2 changed files with 67 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
from thefuck import utils
@utils.git_support
def match(command, settings):
return ('git' in command.script
and 'push' in command.script
and '! [rejected]' in command.stderr
and 'failed to push some refs to' in command.stderr
and 'Updates were rejected because the tip of your current branch is behind' in command.stderr)
@utils.git_support
def get_new_command(command, settings):
return command.script.replace('push', 'push --force')