(Imām Bukhārī narrates): 'Amr ibn Khālid narrated to us, he said: Zuhair narrated to us, from Humaid, from Anas, may Allāh be pleased with him, from the Prophet ﷺ, he said:
Keep your rows straight, because I see you even from behind my back. And one of us used to join his shoulder to the shoulder of his companion, and his foot to the foot of his companion.
حَدَّثَنَا عَمْرُو بْنُ خَالِدٍ، قَالَ حَدَّثَنَا زُهَيْرٌ، عَنْ حُمَيْدٍ، عَنْ أَنَسٍ، عَنِ النَّبِيِّ صلى الله عليه وسلم قَالَ " أَقِيمُوا صُفُوفَكُمْ فَإِنِّي أَرَاكُمْ مِنْ وَرَاءِ ظَهْرِي ". وَكَانَ أَحَدُنَا يُلْزِقُ مَنْكِبَهُ بِمَنْكِبِ صَاحِبِهِ وَقَدَمَهُ بِقَدَمِهِ.
Reference: Sahih Al Bukhari 725