The takbir of the traveller when he ascends, his tasbih when he descends

Riyad as-Salihin (The Meadows of the Righteous)

by Imam Nawawi

171. Chapter: The takbir of the traveller when he ascends, his tasbih when he descends and the prohibition against raising the voice with the takbir

975. Jabir said, "When we went up a slope, we would say, 'Allah is great,' and when we descended, we would say, 'Glory be to Allah.'" [al-Bukhari]

976. Ibn 'Umar said, "When the Prophet, may Allah bless him and grant him peace, and his armies went up a hill, they used to say the takbir and when they went down one, they said, 'Glory be to Allah.'" [Abu Dawud]

977. Ibn 'Umar reported that when the Prophet, may Allah bless him and grant him peace, returned from hajj or 'umra, whenever he went up a hill or a slope, he would say the takbir three times and then would say, "There is no god but Allah alone with no partner. To Him belongs the kingdom and to Him belongs praise and He has power over everything, returning, turning in repentance, worshipping, prostrating to our Lord, praising. Allah has been true to His promise and helped His slave and defeated the parties alone." [Agreed upon]

In a variant of Muslim, "When he returned from military campaigns, expeditions, hajj or 'umra."

978. Abu Hurayra reported that a man said, "O Messenger of Allah, I want to go on a journey, so give me some advice." He said, "You should have fear of Allah and say the takbir on every slope." When the man turned away, he said, "O Allah, roll up the distance for him and make the journey easy for him." [at-Tirmidhi]

979. Abu Musa al-Ash'ari said, "We were with the Messenger of Allah, may Allah bless him and grant him peace, and whenever we climbed up above a valley, we would say, 'There is no god but Allah and Allah is greater" with our voices raised. The Prophet, may Allah bless him and grant him peace, said, 'O people! Be kind to yourselves! You are not calling someone who is deaf or absent. He is with you, listening.'" [Agreed upon]