We consider a discrete system of n simple indistinguishable devices, called agents, forming a connected shape SI on a two-dimensional square grid. Agents are equipped with a linear-strength mechanism, called a line move, by which an agent can push a whole line of consecutive agents in one of the four directions in a single time-step. We study the problem of transforming an initial shape SI into a given target shape SF via a finite sequence of line moves in a distributed model, where each agent can observe the states of nearby agents in a Moore neighbourhood. Our main contribution is the first distributed connectivity-preserving transformation that exploits line moves within a total of O(n log 2 n) moves, which is asymptotically equivalent to that of the best-known centralised transformations. The algorithm solves the line formation problem that allows agents to form a final straight line SL, starting from any shape SI , whose associated graph contains a Hamiltonian path.