Do this:

$ git rev-parse HEAD

This gives you the full commit id, for the short id, run this:

$ git rev-parse --short HEAD