It really is amazing. To be able to mouseover a line of code and see who committed it, link to the commit and see what it was before... It saves so much time
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
Magit is great but it's just so incredibly slow at big repos. For certain things like Instant Fixup magit is still faster than the command line but most of the time I can do it much faster via the command line. Sometimes I'm not even sure whether magit is just slow or my emacs hangs.
Magit hasnt been slow for me since I upgraded to Emacs 26. Older versions of Emacs were not optimized for spawning processes on OSX and it was causing a 10x slowdown for some operations.
Perhaps I should revise my statement. It isn't magit itself that's slow, but rather magit is calling out to slow git commands. And while those git commands are taking up 100% of my CPU, Emacs itself is using 0% CPU and totally unresponsive.
Just a few moments ago I had to kill Emacs because magit was executing this command:
Thanks for making this, it looks great! I'll be giving it a shot tomorrow.
I've been moving more and more to terminal for all of my development. My dev. stack is now: vim; tmux; lynx; ddgr; zsh; and docker. It is game changing for distraction-free programming, consistency between languages, and the ability to use the exact same setup everywhere -- even on remote machines.
We need CLI to work on repo on remote servers. I was using tig but didn't like it for lack of ability to easily navigating file tree on each commit and this seems better.
Comments (229) 38 threads
Earlier commentsThere 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.- https://github.com/jonas/tig
- https://magit.vc/
Magit hasnt been slow for me since I upgraded to Emacs 26. Older versions of Emacs were not optimized for spawning processes on OSX and it was causing a 10x slowdown for some operations.
Actually magit is quite fine for small personal projects. It's just that it absolutely chokes on a large monorepo I'm working on.
Just a few moments ago I had to kill Emacs because magit was executing this command:
Continue this thread — 1 reply
I've been moving more and more to terminal for all of my development. My dev. stack is now: vim; tmux; lynx; ddgr; zsh; and docker. It is game changing for distraction-free programming, consistency between languages, and the ability to use the exact same setup everywhere -- even on remote machines.
All comments shown.
Couldn't load more comments. Check your connection and try again.