The Literal Commandment
You shall not detest an Edomite, for he is your brother; you shall not detest an Egyptian, because you were an alien in his land. The sons of the third generation who are born to them may enter the assembly of the LORD. (Deuteronomy 23:7-8)
The literal commandment is that we should not detest an Egyptian or prevent their third generation children from entering the assembly of the LORD.