Whereas OpenIndiana (build 151a) comes with hg installed by default, there are reasons why you might choose git. Here's how to install it.

First install some necessary packages:

$ pkg install gcc-dev
$ pkg install SUNWscp

Download the latest git sources from http://git-scm.com/:

$ cd /usr/src
$ curl http://code.google.com/p/git-core/downloads/detail?name=git-1.7.7.5.tar.gz > git.tar.gz
$ tar xvzf git.tar.gz

Next, in the Makefile replace "gtar" with "tar" if necessary (depending on your system),
then compile and install it to /usr/local :

$ gmake prefix=/usr/local all
$ gmake prefix=/usr/local install

Export the path and you're done.

$ PATH=/usr/sfw/bin:/usr/bin:/usr/sbin:/usr/local/bin ; export PATH
$ git --version

Enjoy!