Language:
كتاب المغازى
64  
Military Expeditions led by the Prophet (pbuh) (Al-Maghaazi)
(56)
Chapter: The Ghazwa of At-Taif
(56)
باب غَزْوَةُ الطَّائِفِ فِي شَوَّالٍ سَنَةَ ثَمَانٍ
Sahih al-Bukhari 4332

Narrated Anas:

When it was the day of the Conquest (of Mecca) Allah's Messenger (ﷺ) distributed the war booty amongst the people of Quraish which caused the Ansar to become angry. So the Prophet (ﷺ) said, "Won't you be pleased that the people take the worldly things and you take Allah's Messenger (ﷺ) with you? "They said, "Yes." The Prophet (ﷺ) said, "If the people took their way through a valley or mountain pass, I would take my way through the Ansar's valley or mountain pass."

حَدَّثَنَا سُلَيْمَانُ بْنُ حَرْبٍ، حَدَّثَنَا شُعْبَةُ، عَنْ أَبِي التَّيَّاحِ، عَنْ أَنَسٍ، قَالَ لَمَّا كَانَ يَوْمَ فَتْحِ مَكَّةَ قَسَمَ رَسُولُ اللَّهِ صلى الله عليه وسلم غَنَائِمَ بَيْنَ قُرَيْشٍ‏.‏ فَغَضِبَتِ الأَنْصَارُ قَالَ النَّبِيُّ صلى الله عليه وسلم ‏"‏ أَمَا تَرْضَوْنَ أَنْ يَذْهَبَ النَّاسُ بِالدُّنْيَا، وَتَذْهَبُونَ بِرَسُولِ اللَّهِ صلى الله عليه وسلم ‏"‏‏.‏ قَالُوا بَلَى‏.‏ قَالَ ‏"‏ لَوْ سَلَكَ النَّاسُ وَادِيًا أَوْ شِعْبًا لَسَلَكْتُ وَادِيَ الأَنْصَارِ أَوْ شِعْبَهُمْ ‏"‏‏.‏
Reference : Sahih al-Bukhari 4332
In-book reference : Book 64, Hadith 361
USC-MSA web (English) reference : Vol. 5, Book 59, Hadith 621
  (deprecated numbering scheme)