Abdullah bin Abbas reported,

The People of the Book used to let their hair hang down, while the polytheists used to part their hair. The Messenger of Allah ﷺ preferred to align with the practice of the People of the Book in matters where he had received no specific revelation, so he let his forelock hang down. Later, however, he parted his hair.

Ibn Majah 3632

Sahih

حدثنا أبو بكر بن أبي شيبة حدثنا يحيى بن آدم عن إبراهيم بن سعد عن الزهري عن عبيد الله بن عبد الله

عن ابن عباس قال

كان أهل الكتاب يسدلون أشعارهم وكان المشركون يفرقون وكان رسول الله ﷺ يحب موافقة أهل الكتاب قال فسدل رسول الله ﷺ ناصيته ثم فرق بعد

ابن ماجه 3632صحيح
Contents
Reference
Commentary
Ayat
Collection
Sunan Ibn Majah
Book
Clothing
Chapter
Keeping long hair and forelocks
Numbering
Darussalam 3632
Ibn Majah 3632