1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-11-15 14:25:58 +00:00
Files
thefuck/thefuck/rules/git_push_force.py
2015-07-21 15:35:39 +02:00

18 lines
483 B
Python

from thefuck import utils
@utils.git_support
def match(command, settings):
return ('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')
enabled_by_default = False