5 ms·
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 short
by stockkid 8y ago
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.
[0] - https://github.com/sungwoncho/dotfiles/blob/master/zsh/aliases.zsh https://github.com/sungwoncho/dotfiles/blob/master/zsh/alias...
- mehrdadn 8y agoAlso simple but very handy: [alias] amend = commit --amend --no-edit ls = ls-tree --name-only --full-name HEAD tree = log --graph --decorate --oneline --all commit-date = "!gitcommitdate() { (export GIT_COMMITTER_DATE=\"$1\" && git commit --date=\"${GIT_COMMITTER_DATE}\" \"${@:2}\"); } && gitcommitdate" There's also a whole boatload of commands in git-extras for those interested: https://github.com/tj/git-extras/blob/master/Commands.md https://github.com/tj/git-extras/blob/master/Commands.md
- archseer 8y agoPersonally I prefer to alias git to g, then setup my aliases in gitconfig. https://github.com/GitAlias/gitalias 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 https://github.com/thoughtbot/gitsh gitsh > f & rom
- mlthoughts2018 8y agoI 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.
- roryisok 8y agoI think I've met you at a conference. Were you the guy blinking U-S-E-V-I-M on Morse code during conversations
- DoofusOfDeath 8y agoI'm guessing people just ignored it because he was in Insert mode the whole time.
- nickbarnwell 8y agoIf 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. [1]: https://git-scm.com/book/en/v2/Git-Basics-Git-Aliases https://git-scm.com/book/en/v2/Git-Basics-Git-Aliases [2]: https://github.com/nickbarnwell/dotfiles/blob/master/home/.extra/git_aliases https://github.com/nickbarnwell/dotfiles/blob/master/home/.e...
- jordigh 8y agoWith 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.
- __blockcipher__ 8y agoI'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 And obviously bash has an equivalent.