Sunan an-Nasa'i, Hadith 5238 ⓘ
It was narrated from Ibn 'Abbas that: The Messenger of Allah [SAW] used to let his hair hang down (without a parting) and the Mushrikun used to part their hair. The Messenger of Allah [SAW] liked to act in accordance with the People of the Book, in matters where no specific command had been given to him. Then the Messenger of Allah [SAW] parted his hair after that.
أَخْبَرَنَا مُحَمَّدُ بْنُ سَلَمَةَ، قَالَ حَدَّثَنَا ابْنُ وَهْبٍ، عَنْ يُونُسَ، عَنِ الزُّهْرِيِّ، عَنْ عُبَيْدِ اللَّهِ بْنِ عَبْدِ اللَّهِ، عَنِ ابْنِ عَبَّاسٍ، أَنَّ رَسُولَ اللَّهِ صلى الله عليه وسلم كَانَ يَسْدُلُ شَعْرَهُ وَكَانَ الْمُشْرِكُونَ يَفْرُقُونَ شُعُورَهُمْ وَكَانَ رَسُولُ اللَّهِ صلى الله عليه وسلم يُحِبُّ مُوَافَقَةَ أَهْلِ الْكِتَابِ فِيمَا لَمْ يُؤْمَرْ فِيهِ بِشَىْءٍ ثُمَّ فَرَقَ رَسُولُ اللَّهِ صلى الله عليه وسلم بَعْدَ ذَلِكَ .
also referenced under: Book 48, Hadith 199 (In-Book) & Volume 6, Book 48, Hadith 5240 (DarusSalam)