4 ms·
> Is there any way to shorten the amount of keystrokes to use git? Sure, you can just set up aliases in your shell and in git. Set an alias in your shell for g
by chronial 7y ago
> Is there any way to shorten the amount of keystrokes to use git?
Sure, you can just set up aliases in your shell and in git. Set an alias in your shell for git → g and in git for commit → c and you can commit with `g c`.
- j0ba 7y agoAwesome, wasn't aware of git aliases. Thank you.
- Arnavion 7y agoJust be careful that if you define an alias that shadows a built-in command, your alias will be (silently?) ignored. Mostly a problem if a future version of git adds a command and clobbers an alias that used to work.
- ad-hominem 7y agoThese are just aliases, they work with any shell commands, they're not git specific. Just fyi.
- philpem 7y agoThere's a really good starter set in the Git manual: https://git-scm.com/book/en/v2/Git-Basics-Git-Aliases https://git-scm.com/book/en/v2/Git-Basics-Git-Aliases I'm so used to "git co" and "git br" at this point (which are effectively analogues of the same commands on Hg) that I have to think for a minute when I SSH into a machine which doesn't have these set up.