"In time past there have been presented to me for my opinion many non-essential, fanciful theories. Some have advocated the theory that believers should pray with their eyes open. Others teach that, because those who ministered anciently in sacred office were required, upon entering the sanctuary, to remove their sandals and wash their feet, believers now should remove their shoes when entering the house of worship. Still others refer to the sixth commandment, and declare that even the insects that torment human beings should not be killed. And some have put forth the theory that the redeemed will not have gray hair—as if this were a matter of any importance. GW 313.1"
"Neither give heed to fables and endless genealogies, which minister questions, rather than godly edifying which is in faith: so do."
Both passages address the issue of focusing on non-essential matters and fanciful theories that distract from true faith and godly edification.
"I am instructed to say that these theories are the production of minds unlearned in the first principles of the gospel. By such theories the enemy strives to eclipse the great truths for this time. GW 313.2"
"I marvel that ye are so soon removed from him that called you into the grace of Christ unto another gospel: Which is not another; but there be some that trouble you, and would pervert the gospel of Christ. But though we, or an angel from heaven, preach any other gospel unto you than that which we have preached unto you, let him be accursed. As we said before, so say I now again, If any man preach any other gospel unto you than that ye have received, let him be accursed."
Both passages address the issue of false teachings and deviations from the true gospel. Galatians 1:6-9 strongly condemns any alteration of the gospel, while the EGW passage warns against theories that obscure the great truths for this time.
"Those who in their preaching pass by the great truths of God's word to speak of minor matters, are not preaching the gospel, but are dealing in idle sophistry. Let not our ministers spend time in the discussion of such matters. Let those who have any question as to what they should teach, any question as to the subjects upon which they should dwell, go to the discourses of the great Teacher, and follow His lines of thought. The subjects that Jesus regarded as essential are the subjects that we are to urge home today. We are to encourage our hearers to dwell upon those subjects which are of eternal moment. GW 313.3"
"Teaching them to observe all things whatsoever I have commanded you: and, lo, I am with you alway, even unto the end of the world. Amen."
Both passages emphasize the importance of teaching and adhering to the commandments and teachings of Jesus. Matthew 28:20 is a direct command from Jesus to teach all that He commanded, and the EGW passage reinforces this by urging ministers to focus on the essential subjects that Jesus taught.