Abdullah bin Abbas reported,

The Messenger of Allah ﷺ used to let his hair hang down over his forehead, while the polytheists used to part their hair. The People of the Book used to let their hair hang down, and the Messenger of Allah ﷺ liked to conform with the People of the Book in matters concerning which he had received no specific command. Later, the Messenger of Allah ﷺ parted his hair.

Bukhari 3558

Sahih

حدثنا يحيى بن بكير حدثنا الليث عن يونس عن ابن شهاب قال أخبرني عبيد الله بن عبد الله

عن ابن عباس رضي الله عنهما

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

البخاري 3558صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Virtues
Chapter
Description of the Prophet ﷺ
Numbering
Darussalam 3558
Bukhari 3558