There's a decent diagram here:
http://www.trainelectronics.com/limit_switch/You want the second one, with the diodes. Note that the correct direction for the diodes is very important. Set up the first circuit with no diodes, and run it to one limit. Check the polarity of the voltage across the now-open switch and mark the positive terminal. Reverse the control switch, and briefly short the limit switch its stuck at to get the mechanism out of the limit and let it run to the other limit. Now measure and mark the other switch. Power off and add the diodes across the switches, cathodes (diode body end with ring mark round it) to the terminals you marked as positive. N.B. the diodes have to carry the full motor starting current, decreasing as it speeds up till the motor is up to speed or drives out of the limit. The starting current is equal to the (locked rotor) stall current, which is equal to the supply voltage divided by the motor's DC resistance. Although silicon rectifier diodes can survive surge currents of many times their continuous current rating, its advisable to choose a diode with a continuous rating of at least several times the motor's fully loaded running current.
If you are a cheap-skate, you'll find a *very* beefy dual diode in a single package in just about any dead PC PSU. It will be a 3 pin device in a TO-220 or more likely TO-247 package, mounted to a heatsink on the secondary side, with a common cathode which is its center leg. The anodes are the outer legs. You want the one that feeds the +12V rail. Trace from its center leg through tracks and thick wire inductors till you get to a yellow output wire. If you get to any other color wire, try a different diode on the heatsink, or if you can, trace back from the pad with the yellow wires. Once you've extracted it, check both halves are good using the diode check mode of your DMM, or a bulb and a battery, then wire it into circuit with each limit switch between one of its end legs and the center leg. Note that to use a common cathode dual diode you need the connection between the switches to be the positive terminal of the switch from the test procedure in the previous paragraph. If it turns out to be the negative side, swap the order of the switches in the series circuit and re-test to confirm its now positive. The salvaged dual diode wont need heatsinking because it only passes current briefly when driving out of the limit.
Any time you use a gear-motor, or any other type of motor with external high reduction gearing or mechanical advantage, limit switches that physically cut the power to it before it can break your mechanism by forcing it past its limits, are advisable, even if you have limit sensors further in from the mechanical limits, as inputs into your controller for the normal operational limits.