Git faster with mingit
Evan Sendra Mar 26 '17
I wrote mingit because I thought of how much we use git on the command line as day-to-day programmers and how much time we waste typing the same commands again and again. I thought why are we always typing
git commit -m "my super dope commit"
when a simple
g c "my super dope commit"
would suffice? And why
git when by the time I write
g my terminal knows what I'm going for?
So I wrote mingit. It's a small bit of shell code that can be installed with npm -
npm install -g mingit.
Here's the short of it:
g a . // git add . g b other-branch // git branch other-branch g c "made some changes" // git commit -m "made some changes" g commit --amend // it also works with regular subcommands g co master // git checkout master g co mas<TAB><TAB> // auto-complete still works! 🙌 g d // git diff g f // git fetch g i // git init g m hotfix // git merge hotfix g pll // git pull g psh // git push g s // git status
There were other git aliases out there already, but I wanted a git alias that:
- aliased the git command itself
- allowed aliasing of subsequent commands
- Didn’t destroy tab completion (e.g. typing git checkout with the alias still provides things you can checkout)
The official git alias didn’t accomplish #1, but it accomplishes #2 and #3.
Any other aliases I found accomplished #2 but not #3 and potentially not #1 (both deal breakers).
If you want to help make this tool better, I'd love to see your pull request!