diff --git a/thefuck/rules/git_push.py b/thefuck/rules/git_push.py index 22237105..86a2ea5a 100644 --- a/thefuck/rules/git_push.py +++ b/thefuck/rules/git_push.py @@ -1,3 +1,4 @@ +from thefuck.utils import replace_argument from thefuck.specific.git import git_support @@ -9,4 +10,5 @@ def match(command): @git_support def get_new_command(command): - return command.stderr.split('\n')[-3].strip() + push_upstream = command.stderr.split('\n')[-3].strip().partition('git ')[2] + return replace_argument(command.script, 'push', push_upstream)