[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"?
I swear by my mother's grave that I'm telling the truth.
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.
I have the feeling that tufguy might be confused by what you said.
He had it explained to him quite recently.