The Qin dynasty first connected existing wall sections into a single defensive barrier.
After Qin Shi Huang unified China in 221 BC, he ordered frontier fortifications built by earlier states—including Qin, Zhao, and Yan—to be linked and extended along the northern border. The resulting defensive line was an early predecessor of the Great Wall system.
The project was aimed largely at protecting the new empire from incursions by northern peoples, especially the Xiongnu. General Meng Tian oversaw major construction and mobilized very large numbers of workers. Builders used local materials: rammed earth and gravel on plains, and stone in mountainous areas.
The Qin did not create every wall from nothing, nor did later walls follow one continuous route. The Great Wall is a changing network of fortifications built, repaired, and expanded by many regimes. The Han later pushed defenses farther west, while the Ming built the brick-and-stone sections most familiar to modern visitors. Thus, Qin is the best answer for the first major linking of earlier walls, not for the entire structure seen today.