Mergers of two carbon–oxygen white dwarfs have long been suspected to be progenitors of Type Ia supernovae. Here we present our modifications to the cosmological smoothed particle hydrodynamics code gadget to apply it to stellar physics including but not limited to mergers of white dwarfs. We demonstrate a new method to map a one-dimensional profile of an object in hydrostatic equilibrium to a stable particle distribution. We use the code to study the effect of initial conditions and resolution on the properties of the merger of two white dwarfs. We compare mergers with approximate and exact binary initial conditions and find that exact binary initial conditions lead to a much more stable binary system, but there is no difference in the properties of the actual merger. In contrast, we find that resolution is a critical issue for simulations of white dwarf mergers. Carbon burning hotspots which may lead to a detonation in the so-called violent merger scenario emerge only in simulations with sufficient resolution but independent of the type of binary initial conditions. We conclude that simulations of white dwarf mergers which attempt to investigate their potential for Type Ia supernovae should be carried out with at least 106 particles.