Green’s Dictionary of Slang

cock n.1

also cockys, cokke, cokkys, coxe, kocke, kok
[mispron.]

[late 14C–early 19C] a euph. for God.

In exclamations

cock and pie! [? SE pied friar, a Carmelite or Cistercian]

[mid-16C–mid-19C] a mild euph. oath; usu. as by cock and pie!