An early ancestor of this two-deck coincidence plot, though not quite in the form popularly known today, appears under the title of “The Sympathetic Cards” in Jean Eugène Robert-Houdin's Les Secrets de la Prestidigitation et de la Magie,, 1868, p. 227. The difference in effect lies in that two spectators pick identical cards from two decks, while in the classic You Do as I Do effect, one spectator and the performer manage this coincidence.
Many years later evidence was published that J. N. Hofzinser was performing variations of a similar effect in the mid-1800s, including one in which one spectator and the performer chose the two matching cards. See “The Thoughts, or the Thought” in Magic Christian's Non Plus Ultra, Zweiter Band, 2004, p. 202, which Hofzinser may have performed as early as January 3, 1857.
In 1897, August Roterberg, in his New Era Card Tricks, included four methods for this matching effect, all with the participants being one spectator and the performer. The first method, "Marvelous Coincidence", p. 158, is the same as Hofzinser's “The Thoughts”, although with no attribution. The other three methods are variants on that of “Marvelous Coincidence”, focused on eliminating a double-faced deck. These are gathered under the title of "Grande Clairvoyance Mysterieuse", p. 167. The third method (p. 169) was published a year earlier in Conradi's Der Moderne Kartenkünstler, 1896, p. 52, under the title “Gleich und gleich gesellt sich gern”. Conradi claimed this method as his invention, but Roterberg failed to mention Conradi when he included his friend's trick in his book.
The earliest published example using the title of “You Do as I Do” may be “Do as I Do…with a Difference” in Sidney Lawrence's Ten Self-working Card Miracles, 1910, n.p. Lawrence's title implies earlier methods for the effect, which may be those cited above. Twelve years later, Charles Jordan published “Sympathetic Sympathy” in Four Full Hands of Down to the Minute Magical Effects, 1922, p. 27 of the 1947 edition. Rufus Steele later published the same trick, with the same name, largely word-for-word without credit to Jordan in Card Tricks You Will Do, 1928, p. 18. The now-common key-card approach to the plot was described as “Identical Thought” in Walter B. Gibson's “Effective Card Tricks” section in Seven Circles, Vol. 3 No. 1, Apr. 1932, p. 25. It has also been reported that Jon “One-Arm” McDonald had invented an impromptu method by 1931 or earlier; see Genii, Vol. 43 No. 3, Mar. 1979, p. 175, for one version of the story, recounted by Dai Vernon.
The extended “Quadruple Coincidence” version of You Do as I Do was invented by George C. Engel and published in Hugard's Magic Monthly, Vol. 6 No. 12, May 1949, p. 543.