Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

git checkout new branch suggestion improvement #632

Closed
JemarJones opened this issue Apr 20, 2017 · 0 comments · Fixed by #754
Closed

git checkout new branch suggestion improvement #632

JemarJones opened this issue Apr 20, 2017 · 0 comments · Fixed by #754

Comments

@JemarJones
Copy link

Currently if i do the following:

> git checkout my-new-branch
 error: pathspec 'my-new-branch' did not match any file(s) known to git.
> fuck

I get the following suggestion:

> git branch my-new-branch && git checkout my-new-branch

This works fine, but what i more likely meant (and this does the same thing) is:

> git checkout -b my-new-branch

This is much more succinct and should probably be the suggestion in my opinion.

josephfrazier pushed a commit that referenced this issue Jan 1, 2018
This fixes #632

This uses `script_parts` instead of `script.startswith`
to let it work even if there's extra spaces in the command, e.g.

    git  checkout unknown
riley-martine pushed a commit to riley-martine/thefuck that referenced this issue Dec 7, 2023
This fixes nvbn#632

This uses `script_parts` instead of `script.startswith`
to let it work even if there's extra spaces in the command, e.g.

    git  checkout unknown
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant