4 And behold, the word of the LORD came to him: "This man shall not be your heir; your very own son shall be your heir." 5 And he brought him outside and said, "Look toward heaven, and number the stars, if you are able to number them." Then he said to him, "So shall your offspring be." 6 And he believed the LORD, and he counted it to him as righteousness.Following the wandering in the desert, Moses reminds the Israelites they had provoked the LORD in the wilderness, that they had been been rebellious, and the size and might of the enemies they would encounter as they were to cross over the Jordan. This was to drive them to God, and engage their hope in him. Moses assures them of victory, because of the presence of God with them. He warns them not to have the least thought of their own righteousness, as if that was why they would have this coming success.
—Gen. 15:4-6 ESV
4 "Do not say in your heart, after the LORD your God has thrust them out before you, 'It is because of my righteousness that the LORD has brought me in to possess this land,' whereas it is because of the wickedness of these nations that the LORD is driving them out before you. 5 Not because of your righteousness or the uprightness of your heart are you going in to possess their land, but because of the wickedness of these nations the LORD your God is driving them out from before you, and that he may confirm the word that the LORD swore to your fathers, to Abraham, to Isaac, and to Jacob.Man cannot be righteous in the sight of God on his own merits therefore, man must have God's righteousness imputed, or transferred, to him.