Abdullah bin Abbas reported,

The Prophet ﷺ used to let his hair hang down over his forehead, while the polytheists used to part their hair, and the People of the Book used to let their hair hang down. The Prophet ﷺ liked to align with the People of the Book in matters concerning which he had not been given any specific command. Later, the Prophet ﷺ parted his hair.

Bukhari 3944

Sahih

حدثنا عبدان حدثنا عبد الله عن يونس عن الزهري قال أخبرني عبيد الله بن عبد الله بن عتبة

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

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

البخاري 3944صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Virtues of the Ansar
Chapter
Jews coming to the Prophet ﷺ when he arrived in Madinah
Numbering
Darussalam 3944
Bukhari 3944