The OED also says that this is a contracted form of "God be with you", and explains the God-to-good transition thusly (emphasis mine):

A contraction of the phrase God be with you (or ye); see GOD n. 8. The substitution of good- for God may have been due to association with such formulas of leave-taking as good day, good night, etc.

In a quote from 1659, we still have "God":

But mum for that, his strength will scarce supply His Back to the Balcona, so God b' wy.

And then by 1694, we have transitioned to "good":