[STRIKE]1) I swear by the god I didn't do it.[/STRIKE]
2) I swear to [STRIKE]the god[/STRIKE] God, I didn't do it.
You swear to God/someone to assure someone of something.What is the difference between "swear by" and "swear to"?
Another use of "swear by" is, e.g.,
He's been using that arthritis cream for years. He swears by it.
That means he has full confidence in it.