Geologists have been busy little beavers mapping out the boundaries of the many slightly-differing kinds of igneous rock in the Sierra; this map gives an idea of the complexity of the situation in the Yosemite Valley area. (For the Yes, we are So Geekly! file: we have a jigsaw puzzle of a slightly older version of this map.)
The Park visitor center has some good displays describing the differences between tonalite, diorite, granodiorite, and plain old granite. But to be honest, from a distance they all look pretty much the same – massive, dense, salt-and-pepper rocks – and for the non-geologist what really distinguishes rock formations at Yosemite is less their specific ratio of alkali feldspar to plagioclase, and more how jointed and fractured the cooled plutons became. Once the glaciers got to work on Yosemite, joints and fractures were weak spots that allowed the ice to shear away greater quantities of the less-consolidated rock, leaving the more monolithic formations behind and leading to the spectacular current landscape.

(I discovered, on doing some checking, that El Capitan is in fact made up of honest-to-God granite, contra McPhee, quoted here. He was right about Half Dome and Yosemite Falls, though.)
A good introduction to the geology of the Valley can be found here.