Genesis 46:34

That ye shall say, Thy servants’ trade hath been about cattle from our youth even until now, both we, and also our fathers: that ye may dwell in the land of Goshen; for every shepherd is an abomination unto the Egyptians.

In Egypt the work of shepherding was despised as degrading and an abomination. Joseph instructed five of his brothers to answer Pharaoh honestly and frankly that their trade from youth until now, both theirs and their fathers', had been about cattle as shepherds. He did this because he loved righteousness and feared God and did not want them exalted for his sake to honorable positions or taken into the king's special service, so Pharaoh did not try to employ them. By keeping them out of court life he kept them from exposure to temptation amid its corrupting idolatrous influences. Their answer led Pharaoh to permit Jacob and his sons to settle in the best part of Egypt.

Joseph selected Goshen because it was a well-watered and fertile country affording good pastures for flocks. In Goshen they could worship God without disturbance from the ceremonies of Egyptian idolatrous worship and service. Their shepherd occupation kept them apart from Egyptian society and its idolatry, which served to preserve them as a distinct and separate people while dwelling in Goshen. Israel lived in the country round about Goshen until God brought His people out of Egypt with power and mighty signs and wonders.