Sahih al-Bukhari 5917
Narration text is preserved in its supplied Arabic and English. Translated interfaces and reading guides do not add narration translations in other languages.
حَدَّثَنَا أَحْمَدُ بْنُ يُونُسَ، حَدَّثَنَا إِبْرَاهِيمُ بْنُ سَعْدٍ، حَدَّثَنَا ابْنُ شِهَابٍ، عَنْ عُبَيْدِ اللَّهِ بْنِ عَبْدِ اللَّهِ، عَنِ ابْنِ عَبَّاسٍ ـ رضى الله عنهما ـ قَالَ كَانَ النَّبِيُّ صلى الله عليه وسلم يُحِبُّ مُوَافَقَةَ أَهْلِ الْكِتَابِ فِيمَا لَمْ يُؤْمَرْ فِيهِ، وَكَانَ أَهْلُ الْكِتَابِ يَسْدِلُونَ أَشْعَارَهُمْ، وَكَانَ الْمُشْرِكُونَ يَفْرُقُونَ رُءُوسَهُمْ، فَسَدَلَ النَّبِيُّ صلى الله عليه وسلم نَاصِيَتَهُ، ثُمَّ فَرَقَ بَعْدُ.
Narrated Ibn `Abbas:
The Prophet (ﷺ) used to copy the people of the Scriptures in matters in which there was no order from Allah. The people of the Scripture used to let their hair hang down while the pagans used to part their hair. So the Prophet (ﷺ) let his hair hang down first, but later on he parted it.
Full reference and source
Sahih al-Bukhari 5917 In-book : Book 77, Hadith 132 USC-MSA web (English) : Vol. 7, Book 72, Hadith 799 (deprecated)
View source on Sunnah.com (opens in a new tab)