Abdullah bin Abbas reported,

The People of the Book used to let their hair hang down loose, while the polytheists used to part their hair. The Messenger of Allah ﷺ preferred to conform to the People of the Book in matters concerning which he had not been given any instruction, so the Messenger of Allah ﷺ let his forelock hang down loose. Later, he parted his hair.

Muslim 6062

Sahih

حدثنا منصور بن أبي مزاحم ومحمد بن جعفر بن زياد قال منصور حدثنا وقال ابن جعفر أخبرنا إبراهيم يعنيان ابن سعد عن ابن شهاب عن عبيد الله بن عبد الله

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

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

مسلم 6062صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Muslim
Book
Virtues
Chapter
Prophet ﷺ letting his hair hang down and parting it
Numbering
Darussalam 6062
Muslim 6062