diff --git a/thefuck/rules/git_checkout.py b/thefuck/rules/git_checkout.py index ac1efb2c..65705f4f 100644 --- a/thefuck/rules/git_checkout.py +++ b/thefuck/rules/git_checkout.py @@ -34,7 +34,7 @@ def get_new_command(command): fallback_to_first=False) if closest_branch: return replace_argument(command.script, missing_file, closest_branch) - elif command.script.startswith('git checkout'): + elif command.script_parts[1] == 'checkout': return replace_argument(command.script, 'checkout', 'checkout -b') else: return shell.and_('git branch {}', '{}').format(