There were women in those wars (as in later wars) who posed as men to join the army for one reason or another; I don't know how they did it.
A number of female soldiers came from working class backgrounds and were used to hauling heavy stuff around on the farm, etc. They knew they could do the hard work and realized by posing as men they got paid more!