ref
mid 19th century: alteration of damn it .
Univerbation of damn + it.
dammit (interj.)
representation of the oath damn it! as it usually is sounded, 1908.