I do that as well. Also, l=ls, m=make. Then there are shortcuts like gl for git log, gd for git diff, st for git status, gup for git pull --rebase, etc.
ROFL, that’s hilarious. I wish there was an equivalent thing I could install so whenever I press “Esc” on my keyboard I get an annoying animation (I’m trying to teach myself to use Caps-Lock as an Esc key, seeing as I’ll probably be doomed to buy one of the new Macbook Pros with the stupid touchbar soon.)
As someone who uses jk repeatedly to find where they are on screen when i get lost, that might just kill me. But ctrl+c will exit you from insert mode in vim. As will ctrl+[. Both of which have been really nice when using a touchbar mac.
In truth, jk doesn’t work for me, either, because I type a lot of Dutch. I use nj, instead. It rolls nicely off the fingertips. I have also heard people recommend jj.
This is only somewhat relevant, but I just discovered that newer versions of git now support your XDG CONFIG dir, so you can move your global gitconfig to $XDG_CONFIG_HOME/git/config (usually ~/.config/git/config)
Sounds awful, why would I made it harder to get to it? I hate dotfiles, but I’d rather make the file visible where it is, or in some easy to get directory like ~/lib instead of hiding it even more.
Oh yeah, that’s what I need, even more state and configuration. No thanks.
Not that I said ~/lib/file, not ~/lib/foo/config. At least without this XDG nonsense (.local? .config? .cache? .run? Fuck you XDG!), even if my files have stupid dotnames, they are all in one single directory, $HOME…
The one I always mess up is that github just gives you the clone repo location but bitbucket gives you the whole clone command, so I write git clone git clone git@bitbucket.org:.... I wonder whether I can alias the clone command to correct for that.
However, a binary named git-command overrides the built in command. So you could stick a git-clone binary in your path that does what you want and it’ll be invoked rather than the built in command.
I use this to override git clear to run /usr/bin/clear instead of removing all my local changes.
This is one of those articles that rescues itself by going to the absurd.
Another issue about typing
git
is that sometimes I typegti
, so I have installed this beautiful application http://r-wos.org/hacks/gtiI just type
g
, becausealias g=git
. Since it’s one of the most common commands, it deserves to be just one letter.I do that as well. Also, l=ls, m=make. Then there are shortcuts like gl for
git log
, gd forgit diff
, st forgit status
, gup forgit pull --rebase
, etc.Ohh… my git aliases are actually “vim-like”: https://github.com/myfreeweb/dotfiles/blob/master/dev-base/gitconfig
Seriously. Why bother with ls when you have git? Counting command frequency, my alias gs has over 20 times the usage of ls.
etc.
That would blow up my terminal. I have a very… flat… organization strategy. Really even using ls in my home dir is useless without a glob. ?
And my home dir is a git repo anyway.
ROFL, that’s hilarious. I wish there was an equivalent thing I could install so whenever I press “Esc” on my keyboard I get an annoying animation (I’m trying to teach myself to use Caps-Lock as an Esc key, seeing as I’ll probably be doomed to buy one of the new Macbook Pros with the stupid touchbar soon.)
Why bother with an animation? If you really want to stop hitting Escape, buy that Macbook :-P
More seriously, and in case Escape is important because you use Vim: I have grown very fond of
:inoremap jk <Esc>
. Perhaps that’s of use to you, too?As someone who uses
jk
repeatedly to find where they are on screen when i get lost, that might just kill me. Butctrl+c
will exit you from insert mode in vim. As willctrl+[
. Both of which have been really nice when using a touchbar mac.In truth,
jk
doesn’t work for me, either, because I type a lot of Dutch. I usenj
, instead. It rolls nicely off the fingertips. I have also heard people recommendjj
.it doesn’t have to be a burden, I swap esc and caps lock for better ergonomics.
There’s also sl: https://github.com/mtoyoda/sl
Of which I’m a huge fan. Also contains criticism of gti, debian and systemd.
Sorry for linking to a comment on a different platform, but in this instance, I don’t want to waste vertical space here.
Another favorite:
This is only somewhat relevant, but I just discovered that newer versions of git now support your XDG CONFIG dir, so you can move your global gitconfig to
$XDG_CONFIG_HOME/git/config
(usually~/.config/git/config
)Sounds awful, why would I made it harder to get to it? I hate dotfiles, but I’d rather make the file visible where it is, or in some easy to get directory like ~/lib instead of hiding it even more.
But if everyone hides their stuff in the same pattern then config is easy to find.
Then you can change XDG_CONFIG_HOME to point to ~/lib
Oh yeah, that’s what I need, even more state and configuration. No thanks.
Not that I said ~/lib/file, not ~/lib/foo/config. At least without this XDG nonsense (.local? .config? .cache? .run? Fuck you XDG!), even if my files have stupid dotnames, they are all in one single directory, $HOME…
I’ll stick to this scheme, thanks.
could set XDG_CONFIG_HOME=$HOME ;)
Chill. I don’t like excess configuration also.
XDG is indeed overt. However I at least appreciate .cache a bit, because it’s one directory that I can safely remove to reclaim some bytes.
I did this too, except I pipe it through cowsay instead:
git = !exec cowsay git
I like the strace output…
I’m glad someone else had the same thought, it pleased me no end to see it laid out in system calls!
I have never had this problem but thanks for the solution.
It happens to me when I may type something like “git !!” or “git !$” while on the wrong terminal. Nice.
The one I always mess up is that github just gives you the clone repo location but bitbucket gives you the whole clone command, so I write
git clone git clone git@bitbucket.org:...
. I wonder whether I can alias the clone command to correct for that.From the git-config manpage:
From http://stevelosh.com/blog/2013/04/git-koans/#silence
However, a binary named
git-command
overrides the built in command. So you could stick agit-clone
binary in your path that does what you want and it’ll be invoked rather than the built in command.I use this to override
git clear
to run/usr/bin/clear
instead of removing all my local changes.Related: https://github.com/npm/npm/issues/2933
I use gitsh instead, and don’t have to type
git
at all. Tab-complete of branch names is nice too.Thanks for the tip! This and
qgit
are my 2 most common git typos.qgit
happens after doing agit diff
and expecting a long diff opening inless
, but I get a short diff instead, which does acat
to the terminal.So I added
alias qgit='git'
to~/.bash_aliases
.I have NEVER had this issue. Great solution though!
This has to be a joke. Is this a joke? I can’t tell.