Using gravity to slowly nudge an asteroid from its trajectory is impractical and a foolish suggestion. Why?
All asteroids large enough to make this work are known and known not to collide with earth. All asteroids that are a threat to earth are small, unknown and liable to be discovered only a relatively short time - certainly not decades - before impacting earth. There is also good reason to expect those to be more common than the claim that they only hit earth "once a century". A typical dangerous asteroid to be discovered will measure between 15m and 100m. That's a simple matter of the chance to detect such asteroids being very small, while the numbers in which they occur are much larger than anything in the several 100m or km class.
We also happen to have just right stuff to do something about the typical asteroids - rockets capable to carry a few tons of stuff beyond earth orbit, anywhere within the solar system. Crash a compact impactor (lead, steel, depleted uranium ... whatever) into the asteroid at your typical speed of 10km/s or more (depending on the exact trajectory and propulsion used) and the kinetic energy released will be sufficient to break it up into small enough pieces. Each ton of material impacting at this speed has the energy of four Tallboy bombs. Those had enough energy to make craters 24m deep and 30m wide on earth.
This works because the large energy is carried by a small mass with little momentum of itself, which means that the energy will be released in all directions, just like a conventional bomb would. Such a collision creates debris small enough to burn up harmlessly in the atmosphere (albeit in spectacular fashion).