عَنِ ابنِ عُمرَ رَضِيَ اللّهُ عَنْهُمَا قالَ: كانَ النَّبيُّ صَلّى اللّهُ عَلَيْهِ وسَلَّمَ وجيُوشُهُ إِذا علَوُا الثَّنَايَا كَبَّرُوا، وَإذا هَبطُوا سَبَّحُوا. رَوَاهُ أَبُو دَاوُودَ بإسنادٍ صحيحٍ
Ibn Umar (may Allah be pleased with them both) reported: The Prophet (peace and blessings be upon him) and his armies, when they climbed the mountain passes, would say "Allah is the Greatest," and when they descended they would say "Glory be to Allah." Reported by Abu Dawud with a sahih (authentic) chain.
الشرح · explanation
علوا الثنايا: الثنايا جمع ثنية، وهي الطريق في الجبل. هبطوا: نزلوا.
"They climbed the mountain passes": al-thanaya is the plural of thaniyyah, which is a path through a mountain. "They descended": they went down.
الدروس · lessons
مشروعية التكبير والتسبيح عند صعود مرتفع ونزول منخفض. أنّ التكبير والتسبيح عند الصعود والنزول خاص بالمسافر فلا يصح أن يفعله الإنسان في الحضر.
The legitimacy of saying the takbir and tasbih when ascending a height and descending to a lower place. That saying the takbir and tasbih upon ascending and descending is specific to the traveler, so it is not valid for a person to do it while at home.