The only free and comprehensive online etymological dictionary of the Spanish language
contigo (Adverb) "with you"
Prefix con- "with" added to Old Spanish migo "with you," from Latin tecum 'id.,' a compound of te "you" and cum "with." See te and con for their respective etymologies.
Indo-European
Romance
Asturian contigo, Portuguese contigo, Galician contigo

The word mecum in Latin became *tego/*tigo in late Vulgar Latin. The phonological change from -cum to -go led to confusion of its meaning, as it was no longer identifiable as the word cum "with." By the time of Old Spanish, the word (now evolved into tigo) was unclear and con- was added to reinforce its meaning. The same process happened in conmigo, consigo.