Messenger of Allah ﷺ used to go (for Hajj) via Ash-Shajara way and return via Muarras way; and no doubt, whenever Messenger of Allah ﷺ went to Mecca, he used to offer the prayer in the Mosque of Ash-Shajara; and on his return, he used to offer the prayer at Dhul-Hulaifa in the middle of the valley, and pass the night there till morning.
أَنَّ رَسُولَ اللَّهِ ﷺ كَانَ يَخْرُجُ مِنْ طَرِيقِ الشَّجَرَةِ وَيَدْخُلُ مِنْ طَرِيقِ الْمُعَرَّسِ وَأَنَّ رَسُولَ اللَّهِ ﷺ كَانَ إِذَا خَرَجَ إِلَى مَكَّةَ يُصَلِّي فِي مَسْجِدِ الشَّجَرَةِ وَإِذَا رَجَعَ صَلَّى بِذِي الْحُلَيْفَةِ بِبَطْنِ الْوَادِي وَبَاتَ حَتَّى يُصْبِحَ