The large-scale execution of quantum algorithms requires basic quantum operations to be implemented fault-tolerantly. The most popular technique for accomplishing this, using the devices that can be realized in the near term, uses stabilizer codes which can be embedded in a planar layout. The set of fault-tolerant operations which can be executed in these systems using unitary gates is typically very limited. This has driven the development of measurement-based schemes for performing logical operations in these codes, known as lattice surgery and code deformation. In parallel, gauge fixing has emerged as a measurement-based method for performing universal gate sets in subsystem stabilizer codes. In this work, we show that lattice surgery and code deformation can be expressed as special cases of gauge fixing, permitting a simple and rigorous test for fault-tolerance together with simple guiding principles for the implementation of these operations. We demonstrate the accuracy of this method numerically with examples based on the surface code, some of which are novel.Several such families of quantum error-correcting codes have been developed, including concatenated codes [5,6], subsystem codes such as Bacon-Shor codes [7], and 2D topological codes. The most prominent 2D topological codes are surface codes [8] derived from Kitaev's toric code [9], which we will focus on in the remainder of this manuscript. 2D topological codes can be implemented using entangling gates which are local in two dimensions, allowing fault-tolerance in near-term devices which have limited connectivity. In addition, 2D topological codes generally have high fault-tolerant memory thresholds, with the surface code having the highest at ∼1% [10].These advantages come at a cost, however. While other 2D topological codes permit logical single-qubit Clifford operations to be implemented transversally, the surface code does not. In addition, the constraint that computation be carried out in a single plane does not permit two-qubit physical gates to be carried out between physical qubits in different code blocks, precluding the two-qubit gates which, in principle, can be carried out transversally.These two restrictions have led to the design of measurement-based protocols for performing single-and two-qubit logical gates by making gradual changes to the underlying stabilizer code. Measurement-based protocols that implement single-qubit gates are typically called code deformation [11], and protocols that involve multiple logical qubits are usually called lattice surgery [12]. A separate measurement-based technique, called gauge fixing [13], can be applied to subsystem codes, which have operators which can be added to or removed from the stabilizer group as desired, the so-called gauge operators. During gauge fixing, the stabilizer generators of the subsystem code remain unchanged, and can be used to detect and correct errors; so decoding is unaffected by gauge fixing. This is in contrast to code deformation and lattice surgery, where it is not a pri...