3 ms·
After having used git for a few years, I identified what commands I use most frequently and have created two-letter aliases for these; alias st='git status
by eriknstr 10y ago
After having used git for a few years, I identified what commands I use most frequently and have created two-letter aliases for these;
alias st='git status' # STatus
alias dp='git diff' # Diff Pending
alias aa='git add .' # Add All
alias di='git diff --cached' # DIff
alias cm='git commit -m' # CoMmit
alias pu='git push' # PUsh
I've added comments above to show you what I think in my head when I type the two-letter alias in question.
I have a few other two-letter aliases for git as well but the ones above cover about 80% of my use I think.
For the remaining 20% I usually type the command out fully even if I have an alias for it, because those less-frequently used commands are harder to remember the aliases for, whereas the aliases that cover the 80%, I have those in my fingers now without having to think about it.
- marcandre 10y agoIt's way superior to use git aliases instead of shell aliases. In this way autocompletion and autocorrection will work.
- eriknstr 10y agoFor the specific aliases I have, the only one that needs an argument is commit and you can't auto-complete a commit message anyway ;) For the aliases that I sometimes specify a file path for, bash is still able to tab-complete that. So for me, shell aliases are actually the best.
- deleted 10y ago[deleted]