There are deadlines, and they helped, but a lot of it was about having someone I "owed" something to.
Another thing I did was plot my word count per commit. Once per week I would post it to an internal channel at work and add a sentence or two summarising my week. The most interesting thing is that while my output could fluctuate a lot per week, the overall trend was fairly stable.