From the wilderness of Sin the whole Israelite community continued by stages as the Lord would command. They encamped at Rephidim, and there was no water for the people to drink. The people quarreled with Moses. "Give us water to drink," they said; and Moses replied to them, "Why do you quarrel with me? Why do you try the Lord?" But the people thirsted there for water; and the people grumbled against Moses and said, "Why did you bring us up from Egypt, to kill us and our children and livestock with thirst?" Moses cried out to the Lord, saying, "What shall I do with this people? Before long they will be stoning me!" Then the Lord said to Moses, "Pass before the people; take with you some of the elders of Israel, and take along the rod with which you struck the Nile, and set out. I will be standing there before you on the rock at Horeb. Strike the rock and water will issue from it, and the people will drink." And Moses did so in the sight of the elders of Israel. The place was named Massah and Meribah, because the Israelites quarreled and because they tried the Lord, saying, "Is the Lord present among us or not?"
Amalek came and fought with Israel at Rephidim. Moses said to Joshua, "Pick some men for us, and go out and do battle with Amalek. Tomorrow I will station myself on the top of the hill, with the rod of God in my hand." Joshua did as Moses told him and fought with Amalek, while Moses, Aaron, and Hur went up to the top of the hill. Then, whenever Moses held up his hand, Israel prevailed; but whenever he let down his hand, Amalek prevailed. But Moses' hands grew heavy; so they took a stone and put it under him and he sat on it, while Aaron and Hur, one on each side, supported his hands; thus his hands remained steady until the sun set. And Joshua overwhelmed the people of Amalek with the sword.
Then the Lord said to Moses, "Inscribe this in a document as a reminder, and read it aloud to Joshua: I will utterly blot out the memory of Amalek from under heaven!" And Moses built an altar and named it Adonai-nissi. He said, "It means, 'Hand upon the throne of the Lord!' The Lord will be at war with Amalek throughout the ages."