We study the flow past a cylinder whose axis undergoes prescribed oscillations, translating uniformly in a direction transverse to the oncoming flow. We consider modest Reynolds numbers ($Re\leq 100$), for which the flow is two-dimensional; when the cylinder is fixed, vortices are shed periodically in a so-called 2S pattern. We choose the period of the prescribed oscillation to be identical to the period of the vortex shedding for a fixed cylinder. At a fixed Reynolds number of $Re=100$, an increase in the amplitude of the oscillations leads to a change in the topology of the shed vortices: the 2S pattern becomes a P+S pattern. We employ a space–time discretisation to directly compute time-periodic solutions of the Navier–Stokes equations and thus demonstrate that the transition between the two vortex shedding patterns arises through a spatio-temporal symmetry-breaking bifurcation of the time-periodic 2S solution. The P+S solution exists only for a finite range of amplitudes, however, and eventually reconnects with the 2S solution branch via a second symmetry-breaking bifurcation. There are ranges of amplitudes over which the system is bistable and both 2S and P+S could, in principle, be seen in experiments. As the Reynolds number is reduced, the 2S and P+S branches disconnect, but a bistable region remains until the isolated P+S solutions ultimately disappear, leaving only the 2S solution. The inferred stability of the various time-periodic solution branches is confirmed through time integration of the Navier–Stokes equations. Finally, we illustrate the evolution of the vorticity field along the solution branches.