5 The Lord said to Moses, "Go on ahead of the people, and take some of Israel’s elders with you. Take in your hand the shepherd’s rod that you used to strike the Nile River, and go.
6 I’ll be standing there in front of you on the rock at Horeb. Hit the rock. Water will come out of it, and the people will be able to drink." Moses did so while Israel’s elders watched.
7 He called the place Massah and Meribah, because the Israelites argued with and tested the Lord, asking, "Is the Lord really with us or not?"
8 Amalek came and fought with Israel at Rephidim.
9 Moses said to Joshua, "Choose some men for us and go fight with Amalek. Tomorrow I’ll stand on top of the hill with the shepherd’s rod of God in my hand."
10 So Joshua did as Moses told him. He fought with Amalek while Moses, Aaron, and Hur went up to the top of the hill.
11 Whenever Moses held up his hand, Israel would start winning the battle. Whenever Moses lowered his hand, Amalek would start winning.