17At the LORD's command, the whole community of Israel left the wilderness of Sin and moved from place to place. Eventually they camped at Rephidim, but there was no water there for the people to drink.2So once more the people complained against Moses. "Give us water to drink!" they demanded. "Quiet!" Moses replied. "Why are you complaining against me? And why are you testing the LORD?"3But tormented by thirst, they continued to argue with Moses. "Why did you bring us out of Egypt? Are you trying to kill us, our children, and our livestock with thirst?"4Then Moses cried out to the LORD, "What should I do with these people? They are ready to stone me!"5The LORD said to Moses, "Walk out in front of the people. Take your staff, the one you used when you struck the water of the Nile, and call some of the elders of Israel to join you.6I will stand before you on the rock at Mount Sinai. Strike the rock, and water will come gushing out. Then the people will be able to drink." So Moses struck the rock as he was told, and water gushed out as the elders looked on.7Moses named the place Massah (which means "test") and Meribah (which means "arguing") because the people of Israel argued with Moses and tested the LORD by saying, "Is the LORD here with us or not?"
Israel Defeats the Amalekites
8While the people of Israel were still at Rephidim, the warriors of Amalek attacked them.9Moses commanded Joshua, "Choose some men to go out and fight the army of Amalek for us. Tomorrow, I will stand at the top of the hill, holding the staff of God in my hand."10So Joshua did what Moses had commanded and fought the army of Amalek. Meanwhile, Moses, Aaron, and Hur climbed to the top of a nearby hill.11As long as Moses held up the staff in his hand, the Israelites had the advantage. But whenever he dropped his hand, the Amalekites gained the advantage.12Moses' arms soon became so tired he could no longer hold them up. So Aaron and Hur found a stone for him to sit on. Then they stood on each side of Moses, holding up his hands. So his hands held steady until sunset.13As a result, Joshua overwhelmed the army of Amalek in battle.14After the victory, the LORD instructed Moses, "Write this down on a scroll as a permanent reminder, and read it aloud to Joshua: I will erase the memory of Amalek from under heaven."15Moses built an altar there and named it Yahweh-nissi (which means "the LORD is my banner").16He said, "They have raised their fist against the LORD's throne, so now the LORD will be at war with Amalek generation after generation."