Hacker News new | ask | show | jobs
by storyinmemo 1440 days ago
Embrace your habit of mistyping: https://github.com/nvbn/thefuck#readme
1 comments

I use that all the time as a shortcut to push new git branches without having to type the whole name.
In addition to tab complete for branch names, git has a `help.autoCorrect` config item that allows git to automatically correct typos in command names. I weirdly type "git poush" incredibly often, and it's nice for git to pretend I typed "push".
You can enable tab complete for Git including for branch names.

I don't know how I would live without that. I tend to make rather verbose branch names and typing it all out stuff like push would take forever.

Though, you have a much more fun solution.

`git push -u origin HEAD` pushes the current branch to `origin` with the same name you have locally. You could even add an alias for that.
Or set `push.default` to `current` to have plain `git push origin` push to the same remote name, ignoring the configured upstream (you might also want to set `remote.pushDefault` alongside that).