 The newly created national park came under the jurisdiction of the United States Army 's Troop I of the 4th Cavalry on May 19 , 1891 , which set up camp in Wawona with Captain Abram Epperson Wood as acting superintendent . By the late 1890s , sheep grazing was no longer a problem , and the Army made many other improvements . The cavalry could not intervene to ease the worsening condition of Yosemite Valley and Mariposa Grove . The cavalry left another legacy in the park , the ranger hat . From 1899 to 1913 , cavalry regiments of the Western Department , including the all Black 9th Cavalry ( known as the " Buffalo Soldiers " ) and the 1st Cavalry , stationed two troops at Yosemite and brought with them the trooper 's campaign hat with its distinctive Montana Peak we recognize today as the " ranger hat . " This peak had been formed into the trooper 's stetson by veterans of the 1898 Spanish – American War to better shed tropical rain . 
