Hacker News new | ask | show | jobs
by bunderbunder 2797 days ago
It's a combination of the command line itself, and the actual command line apps.

For me, this is the single biggest use case for thefuck:

  $ git push
    fatal: The current branch my-branch-name has no upstream branch.
    To push the current branch and set the remote as upstream, use

      git push --set-upstream origin my-branch-name

  $ fuck
    git push --set-upstream origin my-branch-name [enter/↑/↓/ctrl+c]

  (enter)

I'm pretty unrepentant about that one - I _could_ waste brain cells on keeping track of whether my branch already exists upstream, and I _could_ waste keystrokes typing out the more verbose command myself. But I'm not gonna. Life's too short.
2 comments

Same here, but then, I just ran the following and branches are now auto-created

    git config --global push.default current
Admittedly this isn't a concern for all repo setups, but what about the odd time you don't actually want to autocreate a branch?

Saying/typing fuck won't help you now! Basically, thefuck does give some friction and force you to think about things - not much, but maybe just enough.

From the examples, it looks like you’re given an interactive list of ‘corrected’ commands to cycle through, and it won’t proceed until you hit <enter>.

So if you don’t want to do what it suggests, just bail out.

Tab autocomplete works nicely when configured