The prospect of building quantum circuits using advanced semiconductor manufacturing positions quantum dots as an attractive platform for quantum information processing. Extensive studies on various materials have led to demonstrations of two-qubit logic in gallium arsenide, silicon, and germanium. However, interconnecting larger numbers of qubits in semiconductor devices has remained an outstanding challenge. Here, we demonstrate a four-qubit quantum processor based on hole spins in germanium quantum dots. Furthermore, we define the quantum dots in a two-by-two array and obtain controllable coupling along both directions. Qubit logic is implemented all-electrically and the exchange interaction can be pulsed to freely program one-qubit, two-qubit, three-qubit, and four-qubit operations, resulting in a compact and high-connectivity circuit. We execute a quantum logic circuit that generates a four-qubit Greenberger-Horne-Zeilinger state and we obtain coherent evolution by incorporating dynamical decoupling. These results are an important step towards quantum error correction and quantum simulation with quantum dots.