Al-Bara' bin 'Azib (May Allah be pleased with them) reported:
The Messenger of Allah (ﷺ) used to pass between the rows from one end to the other, touching our chest and shoulders (i.e., arranging the rows) in line and saying, "Do not be out of line; otherwise your hearts will be in disagreement". He would add, "Allah and His angels invoke blessings upon the first rows."[Abu Dawud].
App reference: Book 9, Hadith 100
Arabic/English book reference: Book 9, Hadith 1090