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

feature request: common git branch typos #87

Closed
jonathanong opened this issue Apr 21, 2015 · 5 comments
Closed

feature request: common git branch typos #87

jonathanong opened this issue Apr 21, 2015 · 5 comments

Comments

@jonathanong
Copy link

Jonathans-MacBook-Pro:studio jong$ git checkout amster
error: pathspec 'amster' did not match any file(s) known to git.
Jonathans-MacBook-Pro:studio jong$ fuck
No fuck given
@mattjmcnaughton
Copy link

I can take a look at implementing this if there's interest.

@paramsingh
Copy link

What common typos do you think should be fixed?

  • amster
  • masetr

and?

@nwinkler
Copy link
Contributor

I suggest to take a similar approach to the no_command rule (https://github.com/nvbn/thefuck/blob/master/thefuck%2Frules%2Fno_command.py#L24):

  • Get the list of available branches (from git branch -a)
  • Use a function like get_close_matches (see code example above) to find the one that's closest to what the user typed.

@nvbn
Copy link
Owner

nvbn commented Jul 20, 2015

In 2.1+ git_checkout rule tries to use branch with similar name before creating new.

@nvbn nvbn closed this as completed Jul 20, 2015
amtrivedi91 added a commit to amtrivedi91/thefuck that referenced this issue Aug 31, 2016
amtrivedi91 added a commit to amtrivedi91/thefuck that referenced this issue Aug 31, 2016
riley-martine pushed a commit to riley-martine/thefuck that referenced this issue Dec 7, 2023
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

No branches or pull requests

6 participants
@jonathanong @nwinkler @nvbn @paramsingh @mattjmcnaughton and others