Re:SL(1): Cure your bad habit of mistyping
by storyinmemo on Tuesday July 12, 2022 @06:40PM
(#32076682)
Embrace your habit of mistyping: https://github.com/nvbn/thefuck#readme
[ Parent
| on HN ]
Re:SL(1): Cure your bad habit of mistyping
by SAI_Peregrinus on Tuesday July 12, 2022 @10:30PM
(#32078399)
I use that all the time as a shortcut to push new git branches without having to type the whole name.
Re:SL(1): Cure your bad habit of mistyping
by kelnos on Wednesday July 13, 2022 @12:31AM
(#32079056)
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".
Re:SL(1): Cure your bad habit of mistyping
by gary-kim on Tuesday July 12, 2022 @11:01PM
(#32078575)
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.
Re:SL(1): Cure your bad habit of mistyping
by RagingCactus on Wednesday July 13, 2022 @02:14AM
(#32079520)
`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.
Re:SL(1): Cure your bad habit of mistyping
by mananaysiempre on Wednesday July 13, 2022 @06:05AM
(#32080709)
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).