How people cooperate to provide public goods is a major scientific and societal question. Most existing research shows how people cooperate in stable groups. However, many real-world public good problems occur in groups that gradually change due to old members leaving and new members arriving. We have a limited understanding of how cooperation can be sustained when newcomers arrive whose views and needs might differ from those of the existing members. In this thesis, we examine this issue with lab experiments, a large-scale online game, and a field experiment. We find that newcomers initially contribute differently to public goods than existing members. Over time, newcomers largely conform to existing members. Newcomers are punished more for norm deviations than existing members and have less influence on how public goods are shaped. Altogether, the thesis reveals that cooperation dynamics in changing groups are different from stable groups.