Asim reported,

I asked Anas bin Malik, "Did you used to dislike going between Safa and Marwa?"He replied, "Yes, because it was one of the rites of the days of ignorance, until Allah revealed, 'Indeed, Safa and Marwa are among the rites of Allah. So whoever performs the Hajj to the House or performs the lesser pilgrimage commits no wrong in going between them' [Baqarah 2:158]."

Azami 5032

Sahih

عن عاصم، قال

قلت لأنس بن مالك: أكنتم تكرهون السعي بين الصفا والمروة؟ قال: نعم لأنها كانت من شعائر الجاهلية حتى أنزل الله: {إن الصفا والمروة من شعائر الله فمن حج البيت أو اعتمر فلا جناح عليه أن يطوف بهما}.

الأعظمي 5032صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Hajj
Chapter
Description of the Hajj of the Prophet ﷺ as narrated by Jabir and others, and the rulings mentioned therein
Section
Obligation of walking between Safa and Marwa during Hajj and Umrah
Numbering
Jami al-Kamil 5032 (2nd edition)
Azami 5032