TITLE: Classic type theory textbooks
QUESTION [30 upvotes]: There are many classic textbooks in set and category theory (as possible foundations of mathematics), among many others Jech's, Kunen's, and Awodey's.

Are there comparable classic textbooks in type theory, introducing and motivating their matter in a generally agreed upon manner from the ground up and covering the whole field, essentially?

If not so: why?

REPLY [25 votes]: Although not as comprehensive a textbook as, say, Jech's classic book on set theory, Jean-Yves Girard's Proofs and Types is an excellent starting point for reading about type theory. It's freely available from translator Paul Taylor's website as a PDF. Girard does assume some knowledge of the lambda calculus; if you need to learn this too, I recommend Hindley and Seldin's Lambda-Calculus and Combinators: An Introduction.
As others have mentioned, Martin-Löf's Intuitionistic Type Theory would then be a good next step.
A different approach would be to read Benjamin Pierce's wonderful textbook, Types and Programming Languages. This is oriented towards the practical aspects of understanding types in the context of writing programming languages, rather than purely its mathematical characteristics or foundational promise, but nonetheless it's a very clear and well-written book, with numerous exercises.
The bibliography provided by the Stanford Encyclopedia of Philosophy entry on type theory is quite extensive, and might provide alternative avenues for your research.