The whole Israelite community left the Desert of Sin and traveled from place to place, as the Lord commanded. They camped at Rephidim, but there was no water there for the people to drink.
So they quarreled with Moses and said, "Give us water to drink." Moses said to them, "Why do you quarrel with me? Why are you testing the Lord?"
But the people were very thirsty for water, so they grumbled against Moses. They said, "Why did you bring us out of Egypt? Was it to kill us, our children, and our farm animals with thirst?"
So Moses cried to the Lord, "What can I do with these people? They are almost ready to stone me to death."
The Lord said to Moses, "Go ahead of the people, and take some of the older leaders of Israel with you. Carry with you the walking stick that you used to strike the Nile River. Now go!
I will stand in front of you on a rock at Mount Sinai. Hit that rock with the stick, and water will come out of it so that the people can drink." Moses did these things as the older leaders of Israel watched.
He named that place Massah, because the Israelites tested the Lord when they asked, "Is the Lord with us or not?" He also named it Meribah, because they quarreled.
At Rephidim the Amalekites came and fought the Israelites.
So Moses said to Joshua, "Choose some men and go and fight the Amalekites. Tomorrow I will stand on the top of the hill, holding the walking stick of God in my hands."
Joshua obeyed Moses and went to fight the Amalekites, while Moses, Aaron, and Hur went to the top of the hill.
As long as Moses held his hands up, the Israelites would win the fight, but when Moses put his hands down, the Amalekites would win.
Later, when Moses' arms became tired, the men put a large rock under him, and he sat on it. Then Aaron and Hur held up Moses' hands -- Aaron on one side and Hur on the other. They kept his hands steady until the sun went down.
So Joshua defeated the Amalekites in this battle.
Then the Lord said to Moses, "Write about this battle in a book so people will remember. And be sure to tell Joshua, because I will completely destroy the Amalekites from the earth."
Then Moses built an altar and named it The Lord is my Banner.
Moses said, "I lifted my hands toward the Lord's throne. The Lord will fight against the Amalekites forever."