Deut. 22:5 - "The woman shall not wear that which pertaineth unto a man, neither shall a man put on a woman's garment: for all that do so are abomination unto the LORD thy God."
There's no mention of 'skirts' or 'trousers' in that verse. The substance of that injunction is that men and women should not confuse their gender appearances; and the motive is to discourage the lifestyles that may stem from such practices. Confusion of appearances lead to confusion of gender roles. Such lifestyles may include homosexual tendencies among God's people, which is another abomination (Lev.20:13); or gender roles confused altogether, in the family and society at large.
It is interesting that the dress-sense and fashion of the Old Testament people included the idea that men and women wore garments that had skirts. Notice the masculine pronouns used in Psa. 133:2 - "It is like the precious ointment upon the head, that ran down upon the beard, even Aaron's beard: that went down to the skirts of his garments" and of Ezekiel: "Thou shalt also take thereof a few in number, and bind them in thy skirts" (Ezek. 5:3). So men wore garments that had skirts back then, but not in the sense of 'skirts' (a woman's garment which hangs down from the waist) as we understand them today. The skirts of Aaron's garment were simply in reference to the outer border of the priestly garments.
Several ancient and contemporary civilizations and cultures had and have clearly defined gender dress modes. Even today, the Scots are popular for their kilts (knee-length pleated skirt of tartan wool which is worn by men as part of the traditional dress of the Scottish Highlands). Other traditional dresses worn by both gender in some other cultures include (a) the sarong - skirt made from a piece of fabric wrapped around the body and fastened at the waist and worn by men and women in Malaysia and other Pacific islands; (b) the toga - loose draped garment worn by citizens of Ancient Rome; (c) robe - any long loose garment (including the gown); and other types like (d) the tunic - usually long upper garment worn by women, but for the men depicts loose-fitting garment often without sleeves and often belted: worn in ancient Greece and Rome.
Some believers assume that Deut. 22:5 is condemning women wearing trousers and men wearing skirts. However, that is not what Scripture indicates. As we have seen, the substance and motive for that verse is to discourage any confusion of gender identity and roles among people professing to belong God. There are professional vocations that require a dress code that include the idea of trousers worn by both men and women, such as civil and petroleum engineering (the overalls they wear in field of operation), and some military service posts. I remember during our NYSC orientation, some ladies wanted to make an issue out of the khaki trousers; they wear given the option of either following the call of orientation service or quit camp.
Of course, what you wear tells who you are. In the NT, women are particularly admonished to "be modest and sensible about their clothes and to dress properly" as befitting women professing to be godly. (I Tim. 2:9, 10). Men and women who profess godliness in their lives don't want to misrepresent their calling, and that's why we're admonished in the OT verse above to not mix up our dress sense to risk confusing our gender identity and roles, because "from the beginning of the creation God made them male and female" (Mark 10:6).