"And the LORD said to Joshua" (Joshua 1:1). This is what Scripture says: "He who tends a fig tree shall eat its fruit" (Proverbs 27:18). Our rabbis taught: one who sees a fig tree in a dream, his learning is preserved for him, as it is said, "He who tends a fig tree shall eat its fruit."
One Who Tends the Fig Tree Eats Its Fruit
Yalkut Shimoni on Nach 2:1
ויאמר ה' אל יהושע (יהושע א, א) זש"ה נוצר תאנה יאכל פריה. שנו רבותינו הרואה תאנה בחלום תורתו משתמרת לו שנא' נוצר תאנה יאכל פריה.