In the Middle Ages women in the Italian Alps had substantially more rights on collective properties than in the Modern Age. The documental evidence shows a progressive erosion of women's rights and a convergence toward gender-biased inheritance systems. We tracked the evolution of inheritance regulations on collective land in the peasant communities of Trentino over a period of six centuries (13th-19th). Considering a panel of hundreds of communities, we provide a long-term perspective of institutional change. When population pressure increased, a patrilineal system emerged as a protective measure to preserve the per-capita endowment of collective properties within a community. This study raises general issues about the role of local level versus centralized decision-making in delivering gender equality and about the long-term trade-off between the protection of common resources and a healthy genetic pool at the community level.