Would you be talking about Sheepfarmer’s Daughter by Elizabeth Moon?

The description below contains spoilers:
Paksenarrion Dorthansdotter, headstrong daughter of a sheep farmer on the north edge of the kingdom, dreams of being a hero out of legend, of fame and magic swords and great deeds. When her father tells her she must marry the neighbor's son, she runs away from home to join the mercenary company her cousin told her about. But military life and warfare aren't anything like her daydreams...yet she holds to both her duty and her dreams. In the end, she pays the price that heroism demands and becomes the paladin who saves a kingdom...but the journey is longer and darker than she ever imagined. She has to confront and overcome her strengths as well as her weaknesses...and her triumph redeems more than herself.
It’s part of the series “The Deed of Paksennarion” Originally written as one long story, it was broken into three for practical reasons when first published.

Spoilers about the series:
Sheepfarmer's Daughter takes her from the farm through three fighting seasons as a mercenary in Duke Phelan's Company. Divided Allegiance describes her departure from Phelan and her training to become a paladin of Gird....a journey that ends in disaster. Oath of Gold finishes her story of recovery and redemption.