Then when he says, "Now the things which I write to you, behold, before God I lie not," he confirms his statements with an oath. As if to say: The things I now write to you about myself, behold, are so well known that it is obvious I lie not. And this I say before God, i.e., with God as my witness. The Apostle here takes an oath not for a slight reason, but for the sake of those for whom it was necessary, that they might believe. For had he not sworn, they would not have believed him. "Before God, in Christ we speak" (2 Cor 2:17); "God is my witness" (Rom 1:9).
But what does the Lord say in M...atthew (5:37)? "Let your speech be: Yea, Yea; No, No. And that which is over and above these is of evil." The answer to this is that it is of the evil of him who does not believe, or of the evil of punishment which compels one to swear.
Source: Commentary on Galatians