Language:
كتاب المغازى
64  
Military Expeditions led by the Prophet (pbuh) (Al-Maghaazi)
(47)
Chapter: The Ghazwa of Al-Fath during Ramadan
(47)
باب غَزْوَةِ الْفَتْحِ فِي رَمَضَانَ
Sahih al-Bukhari 4279

Narrated Tawus:

Ibn `Abbas said, "Allah's Messenger (ﷺ) travelled in the month of Ramadan and he fasted till he reached (a place called) 'Usfan, then he asked for a tumbler of water and drank it by the daytime so that the people might see him. He broke his fast till he reached Mecca." Ibn `Abbas used to say, "Allah's Apostle fasted and sometimes did not fast while traveling, so one may fast or may not (on journeys)"

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