A babe in arms who "pulls" her mother's hair is only behaving instinctively: all primate infants grasp their mothers' "fur" for stability while their mothers move about.
Tragically, when (human) mothers deem hair-pulling to be inappropriate, hurtful behavior, then something designed by Nature to promote closeness becomes instead a point of contention.
It would be so much easier to go with the flow. Simply leaning into the pull would stop the pain, and the mother could cheerfully redirect the baby's grasp to her clothing, for example.
The key to this shift from painful conflict to joyful partnership — which is possible in any parent/child interaction, at any age — is how you interpret your child's behavior. You feel more like a partner when you think, "She's just doing what comes naturally," than when you think, "She's hurting me!"
So today pay close attention to your interpretations, and choose interpretations that feel good and inspire you to acts of partnership.