Personally I have been typing all git commands manually into the terminal and never felt a need for GUIs or tools such as this.
There are a number of git shortcuts defined in my zsh aliases [0]. It goes like:
# Git aliases
alias g='git'
alias ga='git add'
alias ghb='git browse' # hub
alias ghpr='git pull-request' # hub
alias gp='git push'
alias gpoh='git push origin HEAD'
...
Using these aliases, we rarely have to type more than 3-4 characters for a git command. Savings and efficiency not only add up over years of using git, but also accelerate as you become more proficient in using your own aliases that fit your special needs.
I personally prefer to use a combination of a foot pedal and eye tracking cameras to enter a Reed-Solomon code of taps and blinks uniquely mapping to git commands.
If you install bash-completion or use git-aliases [1], you can also get tab completion working for those aliased commands like so [2]. Lets you save some typing even when you need to pass a rarely used (or difficult to remember) flag.
With Mercurial, I like that all commands can be abbreviated to their shortest unique prefix, plus some built-in aliases. So I type a lot of `hg up`, `hg pus`, `hg ci`, `hg pul`, `hg bo`, and so forth. Most of these are almost the same length as your aliases.
Whenever I have to touch git and `git co` doesn't work, I think, okay, fine, we'll go through the full dress rehearsal; `git checkout` it is.
Plus, actually sane command names, and super powerful functionalities (for example, answering to another comment, you always could "hg blame (annotate)" an arbitrary version of a file without having to check it out first)!
I've been playing around with hub recently, but ended up commenting out the "source hub alias" line because a) since I use aliases, you might as well be explicit, b) I'm tired of having to pipe my aliases to `sed 's/hub/git/g'` when I do `which my_git_alias` to send to other people, and c) I don't want to support github conflating the two when it's not that hard to remember which does what even if you don't use aliases.
Another tip, I only occasionally need git autocompletion withh aliases, but in zsh you can do something like this:
# Enable zsh git completion for our aliases.
# See https://github.com/mislav/dotfiles/blob/d82e79b8a500891a02ab28171974d68be7a35e12/shrc/git.sh
if [ -n "$ZSH_VERSION" ]; then
compdef _git g=git
compdef _git gc=git-commit
compdef _git gco=git-checkout
compdef _git gd=git-diff
compdef _git gb=git-branch
compdef _git gst=git-status
compdef _git gp=git-push
compdef _git gd=git-diff
fi
Comments (229) 38 threads
Show all comments
Showing thread 10 of 38
There are a number of git shortcuts defined in my zsh aliases [0]. It goes like:
Using these aliases, we rarely have to type more than 3-4 characters for a git command. Savings and efficiency not only add up over years of using git, but also accelerate as you become more proficient in using your own aliases that fit your special needs.[0] - https://github.com/sungwoncho/dotfiles/blob/master/zsh/alias...
https://github.com/GitAlias/gitalias
g f && g rom
git fetch && git rebase origin/master
You could go nuts and make it even shorter with https://github.com/thoughtbot/gitsh
gitsh > f & rom
Continue this thread — 1 reply
[1]: https://git-scm.com/book/en/v2/Git-Basics-Git-Aliases [2]: https://github.com/nickbarnwell/dotfiles/blob/master/home/.e...
Whenever I have to touch git and `git co` doesn't work, I think, okay, fine, we'll go through the full dress rehearsal; `git checkout` it is.
Another tip, I only occasionally need git autocompletion withh aliases, but in zsh you can do something like this:
And obviously bash has an equivalent.