Many long distance hikers pass through the Yosemite Wilderness on the John Muir Trail which runs from Yosemite Valley to Whitney Portal, and the Pacific Crest Trail which runs between the US-Mexico border and Canada.
Wilderness permits for long distance hikes may be obtained for the entire trip from the permit station nearest your entry point. The permit will be honored by agencies for all wilderness areas covered on it.
Food resupply can be accomplished directly at stores en route, although selection is limited. The only stores near these trails in Yosemite are in Tuolumne Meadows and Yosemite Valley.
It is also possible to mail yourself non-perishable supplies or arrange to have your food delivered to a certain place at a certain time. See the section on Hiker Food Caches.