The original phrase was "in the name of God". The idea was that the speaker must tell the truth. They must swear an oath.

So:

Judge: *Tell me, did you steal the bread?*

Accused: *In the name of God, I swear that I did not steal the bread.*

or 

Lord of the manor: *In the name of God man, What are you doing at my door?*

Interloper: *My lord I am only a poor peasant, trying to beg a crumb. This I swear.*