I prayed two rakahs with the Prophet ﷺ at Mina, and with Abu Bakr and Umar, and with Uthman during the early part of his caliphate. Then he began praying it in full.
صليت مع النبي ﷺ بمنى ركعتين، وأبي بكر وعمر، ومع عثمان صدرا من إمارته ثم أتمها.
It was narrated by Bukhari in the chapter on shortening prayer (1082), and Muslim in the chapter on the prayer of travelers (694), both from the hadith of Ubaydullah, from Nafi, from Ibn Umar, as mentioned. The majority of scholars, Abu Hanifa, Shafii, Ahmad, and others, held that this shortening applies specifically to someone at Mina who is a traveler. They said that the people of Makkah, however, are not permitted to shorten the prayer at Mina. Umar bin Khattab used to lead them in prayer and would shorten it, and when he finished with the closing salutation, he would turn and say, "Complete your prayer, people of Makkah, for we are travelers." Nothing similar has been transmitted from the Prophet, since it was already widely known from him that completing the prayer was the standard practice for residents, and this became a matter of general, well established knowledge.Khattabi said in his book Maalim (2/415), "Ismail bin Muhammad bin Khashk bin Mahraz narrated to me, saying, Salama bin Shabib narrated to us, saying, Walid bin Muslim said, I arrived in Makkah while Muhammad bin Ibrahim was its governor. He had received instructions to shorten the prayer at Mina and Arafah, and he did shorten it. I saw Sufyan Thawri stand up afterward and repeat the prayer, while Ibn Jurayj stood and built upon his own prayer, completing it in full. Walid said, I then entered Madinah and met Malik bin Anas. I mentioned this to him and told him what the governor had done, and what Sufyan and Ibn Jurayj had done. He said, The governor was correct and Ibn Jurayj was mistaken. Then I traveled to Syria and met Uzai, and mentioned this to him. He said, Malik was correct, and the governor was correct, but Sufyan and Ibn Jurayj were mistaken. Walid said, Then I entered Egypt and met Shafii, and mentioned this to him. He said, The governor was mistaken, Malik was mistaken, Uzai was mistaken, but Sufyan was correct, and Ibn Jurayj was correct."Khattabi added, "As for Ibn Jurayj, he simply built upon his own prayer, because it is his position that someone performing an obligatory prayer may pray behind someone performing a voluntary one. Sufyan, on the other hand, repeated his prayer, because he does not hold that someone performing an obligatory prayer may pray behind someone performing a voluntary one. In his view, the governor's prayer was voluntary, since he shortened it while being a resident of Makkah serving as its governor. So Sufyan started his prayer over again. This is also the position of the followers of reasoned opinion on this matter."Malik, Uzai, and Ishaq held that when the imam shortens the prayer, those praying behind him should shorten it as well, whether they are residents of Makkah or not.His eminence Shaykh Abdul-Aziz bin Baz, may Allah have mercy on him, was asked, "Is the shortening of prayer for the people of Makkah at the sacred sites specific to pilgrims only, or does it also include vendors and others who are present at the sites without performing Hajj?"He answered, "The well known position among scholars is that this shortening is specific to pilgrims among the people of Makkah only, according to those who permit it for them. The majority, however, hold that the people of Makkah do not shorten or combine prayers, since they are not travelers, and they must all complete their prayers in full and pray each prayer at its proper time. But according to those who permit it for pilgrims, it is specific to pilgrims alone among the people of Makkah, and this is the more correct view, since the Messenger did not instruct them to complete their prayers in full. As for vendors and others who did not come with the intention of performing Hajj, they must complete their prayers in full and not combine them, like the rest of the residents of Makkah."