The present invention relates to the field of coal mining technology, in particular to a method for retaining roadways along gobs, comprising the following steps: S1, excavating a first roadway on the side adjacent to the second mining face on the first mining face, The roadway is supported, and at the same time, the side of the first roadway close to the second mining face is prefabricated; S2, before the mining of the first mining face, the roof of the first mining face is prefabricated with cracks; S3, at the Excavate the second roadway on the side near the side of the roadway on the secondary mining face, and support the second roadway. The invention solves the problems of high pressure, high stress and serious deformation of the concrete wall in the commonly used gob-side retaining roadway. During the excavation of the previous working face, the concrete wall of the gob-side retaining is prefabricated in advance, and the process during the mining of the working face is reduced. The degree of complexity increases the recovery speed of the previous working face, and the secondary roadway of gobside retaining often needs to be repaired, which requires a large amount of work and high difficulty. The present invention is a new roadway for the next working face, so there is no need for roadway repair.