To prefix this let me explain to you that I have demon hair. It's fine and thick, down to my butt, and likes nothing so much as to tangle into an impenetrable mat. It's the kind of situation that makes you eye the scissors.
But I'm a hiker, so for years I just muscled through it. The modus operandi was throw it in a braid, hike, then spend the next week slowly coaxing sticks and knots out of my hair until I had a giant, but clean, frizz-ball. When I decided to thru-hike the Appalachian Trail* I was pretty sure I'd just have to shave my head at the end.
About a week into the hike I first tried to brush my hair. It was a disaster. Two hours of brushing with my tiny brush left a lot of knots, a sore scalp, and was just discouraging as to the future of my hair. In short it was what I'd experienced coming back from every trip I'd gone on. Shaving loomed. Two weeks later I had another chance to shower and something magical happened. This time I didn't bother with the pre-shower brush-out. Instead I just jumped in and finger-combed out my filthy hair before washing it. It took awhile, but I was able to work out almost all the knots. It only got better from there on out too. In fact, while on the trail, my hair got longer for the first time in years: it was enjoying this neglect!
The difference? My hair was dirty. Filthy even. Impossible you say! That could only make it worse. Not true. If you stop and think about it dirty hair means each strand is coated in oil, which will help keep it separated from its neighbors. The best way I've found to set up this lovely knot-repelling oil-coated situation before getting into the woods is simply to not wash my hair for as long as possible. Of course just ignoring it would cause many of the same problems as starting a backpacking trip with clean hair, so what I do instead is brush my hair out in the shower every day, but skip the washing step. This helps keep the hair separated and distributes the oil evenly throughout. Obviously this oil can pick up dirt and eventually become downright disgusting, but that takes several weeks. While hiking, washing lightly every week or week and a half is enough to keep me out of the disgusting zone without resulting in inhuman attack knots.
Everyone's body chemistry is different, but if you've considered head shaving due to backpacking then washing it a little less often might just be the key.
* Note: I decided I'd do the whole thing. While hiking I decided to only do 1,000 miles (2.5 months) to allow time to try farming that summer as well. I can't wait to do the other half.