14 And the Lord said to Moses, "Behold, the days approach when you must die. Call Joshua and present yourselves in the tent of meeting, that I may commission him." And Moses and Joshua went and presented themselves in the tent of meeting. 15 And the Lord appeared in the tent in a pillar of cloud. And the pillar of cloud stood over the entrance of the tent. 16 And the Lord said to Moses, "Behold, you are about to lie down with your fathers. Then this people will rise and whore after the foreign gods among them in the land that they are entering, and they will forsake me and break my covenant that I have made with them. 17 Then my anger will be kindled against them in that day, and I will forsake them and hide my face from them, and they will be devoured. And many evils and troubles will come upon them, so that they will say in that day, 'Have not these evils come upon us because our God is not among us?' 18 And I will surely hide my face in that day because of all the evil that they have done, because they have turned to other gods. 19 "Now therefore write this song and teach it to the people of Israel. Put it in their mouths, that this song may be a witness for me against the people of Israel. 20 For when I have brought them into the land flowing with milk and honey, which I swore to give to their fathers, and they have eaten and are full and grown fat, they will turn to other gods and serve them, and despise me and break my covenant. 21 And when many evils and troubles have come upon them, this song shall confront them as a witness (for it will live unforgotten in the mouths of their offspring). For I know what they are inclined to do even today, before I have brought them into the land that I swore to give."

22 So Moses wrote this song the same day and taught it to the people of Israel.

Matthew Henry's Commentary on Deuteronomy 31:14-22

Commentary on Deuteronomy 31:14-22

(Read Deuteronomy 31:14-22)

Moses and Joshua attended the Divine Majesty at the door of the tabernacle. Moses is told again that he must shortly die; even those who are most ready and willing to die, need to be often reminded of its coming. The Lord tells Moses, that, after his death, the covenant he had taken so much pains to make between Israel and their God, would certainly be broken. Israel would forsake Him; then God would forsake Israel. Justly does he cast those off who so unjustly cast him off. Moses is directed to deliver them a song, which should remain a standing testimony for God, as faithful to them in giving them warning, and against them, as persons false to themselves in not taking the warning. The word of God is a discerner of the thoughts and intents of men's hearts, and meets them by reproofs and correction. Ministers who preach the word, know not the imaginations of men; but God, whose word it is, knows perfectly.