||Moses said to Joshua, 'Choose men for us, and prepare for battle against Amalek. Tomorrow, I will stand on top of the hill with the staff of God in my hand.'
Vayomer Moshe el-Yehoshua bechar-lanu anashim vetse hilachem ba'Amalek machar anochi nitsav al-rosh hagiv'ah umateh ha'Elohim beyadi.
Joshua was a grandson of Elishama son of Amihud, the prince of the tribe of Ephraim (1 Chronicles 7:27; Numbers 1:10). Since the Ephraimites were direct descendants of Joseph, they were never enslaved (Sifethey Cohen on Exodus 14:3). The Ephraimites retained a strong militaristic tradition (1 Chronicles 7:21; Targum Yonathan on Exodus 3:17; Pirkey Rabbi Eliezer 48), and Joshua's father Nun or Non was an important general (Yalkut Shimoni on Chronicles 1177). Joshua was Moses' assistant even in Egypt (cf. Sh'moth Rabbah 19:5), and it was at that time that Moses changed his name from Hoshea to Joshua (Numbers 13:16, Rashbam ad loc.; Ramban here).