The meaning of the expression "by God"
What is the meaning of the expression "by God" here in the passage below?
I have only heard of “to God” as in "I swear TO God."
Is it correct to say "I wear by God?" If so, what mean then? Is there a difference between these two prepositions when used?
Or maybe "by God" doesn't carry much meaning, sort of like "Oh my god" or "gosh"?
["By God, it's lucky I come by!" said Muley. "'Cause ol' Tom worried himself. When they was fixin' to move, by God. I tol' him that, an' Tom says, 'I'm worryin' myself about Tommy. S'pose he comes home an' they ain't nobody here. What'll he think?' I says, 'Whyn't you write down a letter?' An' Tom says, 'Maybe I will. I'll think about her...”]
– The Grapes of Wrath