{"thread":{"id":"27881","subject":"stupid git alias trick","startedAt":"2011-07-21T23:06:29Z","lastAt":"2011-07-21T23:06:29Z","messageCount":1,"participants":["Eric Blake"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"171827","messageId":"4E28B0F5.2090705@redhat.com","threadId":"27881","inReplyTo":null,"subject":"stupid git alias trick","fromName":"Eric Blake","fromEmail":"eblake@redhat.com","sentAt":"2011-07-21T23:06:29Z","receivedAt":"2011-07-21T23:06:29Z","isPatch":false,"sender":{"key":"eblake@redhat.com","avatar":"https://avatars.githubusercontent.com/u/32933908?v=4"},"body":"Thought I'd share this one, in case anyone else finds it useful.\n\nEvery so often, I find myself typing \"git \", then pausing while thinking \nof which command I meant to run (commit, rebase, push?), then realizing \nthat I actually need to make more edits in my editor first.  On \ncompletion of that task, I come back to terminal and type \"git \nblah<ENTER>\" out of habit, not realizing that I'm not starting from an \nempty prompt.  Of course, \"git git blah\" is not a valid command, but if \nyou have help.autocorrect configured, this ends up auto-correcting to \n\"git init blah\" instead, and while that often ends up failing due to \nunexpected arguments for 'git init', I've actually had scenarios where \nit succeeds at doing something, but certainly not the \"blah\" I had in mind.\n\nBut thanks to aliases, this is no longer a problem:\n\ngit config --global alias.git '!git'\n\nand now, typing \"git git blah\" results in the execution of the git \nalias, which in turn runs \"git blah\" like I intended.  Yay for:\n\ngit git git git git git git git git git status\n\n-- \nEric Blake   eblake@redhat.com    +1-801-349-2682\nLibvirt virtualization library http://libvirt.org\n"}]}