I heard something about this, only in the past few months, but I can't remember where. Apparently, the way to create habits is to trick yourself by doing something almost ridiculous or trivial. For example, say you want to start flossing regularly. For a lot of people, this is a tough thing to make a habit of. The suggestion is to just floss one tooth, once a day. Don't even try to floss two teeth the next day. Just keep flossing one tooth every day and try not to think about starting a flossing habit.
And then, one day, so the suggestion goes, you'll just go ahead and spontaneously floss all of your teeth and continue to do so in the days after that. You've tricked yourself into the habit, because you had no conscious resistance to committing to flossing one tooth; and in the meantime, by flossing that one tooth, your subconscious built the habit. Once the habit was firmly in place, your conscious brain no longer had any resistance to put up.
Something along those lines is supposed to work for exercise, and many other things as well.