User-friendly GIT CLI

How to get a user-friendly GIT CLI:

git config --global     "status --short --branch"
git config --global alias.d      "diff --no-prefix"
git config --global alias.dc     "diff --no-prefix --cached"
git config --global     commit
git config --global alias.forget "reset HEAD"
git config --global alias.psuh   push
git config --global alias.puhs   push

git config --global --replace-all core.pager ""
git config --global push.default simple

echo alias hg=git >> ~/.bash_aliases

There you go.


I wrote this post two years ago, and I still find myself not only needing it regularly, but also updating it. So, here's a little changelog. Since this blog post was originally incarnated, I've changed:

  • git st now also has --branch, so I won't need git status to see the branch

  • git d and git dc have --no-prefix, so that I can copy-paste the file path out of the diff using a double-click to mark the file name, instead of having to manually not-select the "a/" part.


Customers who bought this might also like hgit.