Ibn Abbas (may Allah be pleased with them both) said: Whoever matted his hair, or braided it, or twisted it, or tied it in a knot, is according to what he intended. And Ibn Umar (may Allah be pleased with them both) said: Shaving the head is necessary.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الحج / 9589