Monday, September 28, 2009

git-wtf + git-sh

git-sh is awesome. As well as git-wtf. I bet most people are not aware of git-wtf, but they certainly should, cause it is an extremely convenient and useful tool when you are working with several branches and/or remotes. A little example of git-wtf output:

Local branch: heads/master
[x] in sync with remote

Remote branch: origin/master (git@github.com:account/project.git)
[x] in sync with local

Feature branches:
[x] ticket_827 is merged in
[ ] ticket_831 is NOT merged in (1 commit ahead; 18 commits behind)
- [dependencies] Depend on library X, version Y [bfda321]

(see http://github.com/michaelklishin/git-wtf)

The problem

If you are using git-sh, you have to type

branch!repo> command git-wtf 

which is long and annoying.

The solution

This post shows how to call git-wtf  just by typing

branch!repo> wtf 

in git-sh console.

Clone the fork of git-wtf, which contains a pretty Makefile (I hope it will be merged into main repo soon):

$ git clone http://github.com/DanielVartanov/git-wtf 

Run make to configure correspondent aliases for git and git-sh:

$ make
git config --global alias.wtf '!git-wtf'
echo -e "\n# git-wtf\ngitalias wtf='git wtf'" >> ~/.gitshrc 


Run make install if git-wtf script is not in PATH-directory already:

$ sudo make install
install git-wtf /usr/local/bin 


You can simply run wtf command in git-sh console now:








Enjoy :-)
 
My wishlist