So Isaac moved away from there and encamped in the Valley of Gerar, where he settled. Isaac reopened the wells that had been dug in the time of his father Abraham, which the Philistines had stopped up after Abraham died, and he gave them the same names his father had given them. Isaac’s servants dug in the valley and discovered a well of fresh water there. But the herders of Gerar quarreled with those of Isaac and said, “The water is ours!” So he named the well Esek, because they disputed with him. Then they dug another well, but they quarreled over that one also; so he named it Sitnah. He moved on from there and dug another well, and no one quarreled over it. He named it Rehoboth, saying, “Now the Lord has given us room and we will flourish in the land.” From there he went up to Beersheba. That night the Lord appeared to him and said, “I am the God of your father Abraham. Do not be afraid, for I am with you; I will bless you and will increase the number of your descendants for the sake of my servant Abraham.” Isaac built an altar there and called on the name of the Lord . There he pitched his tent, and there his servants dug a well. Meanwhile, Abimelek had come to him from Gerar, with Ahuzzath his personal adviser and Phicol the commander of his forces. Isaac asked them, “Why have you come to me, since you were hostile to me and sent me away?” They answered, “We saw clearly that the Lord was with you; so we said, ‘There ought to be a sworn agreement between us’—between us and you. Let us make a treaty with you that you will do us no harm, just as we did not harm you but always treated you well and sent you away peacefully. And now you are blessed by the Lord .” Isaac then made a feast for them, and they ate and drank. Early the next morning the men swore an oath to each other. Then Isaac sent them on their way, and they went away peacefully. That day Isaac’s servants came and told him about the well they had dug. They said, “We’ve found water!” He called it Shibah, and to this day the name of the town has been Beersheba. When Esau was forty years old, he married Judith daughter of Beeri the Hittite, and also Basemath daughter of Elon the Hittite. They were a source of grief to Isaac and Rebekah.
Bible.com/app