Shifters come in different types, but they all do the same job. When you move them one way, they pull precise amounts of gear cable to move your chain across your cassette. When you move them the other way, they release a precise amount of cable, allowing the spring in the derailleur to move the chain the opposite way across your cassette.
There are three main types: twistshifters rotate around the handlebars, while triggershifters have two separate levers, one to pull cable and one to release. STi levers on road bikes combine the shifters with the brake levers. Both twistshifters and triggershifters have loyal fans because, in practice, they both work fine. In situations where your grip is likely to get very slippery, triggershifters have a slight advantage, but twistshifters are less vulnerable to damage in a crash because they don’t have any protruding levers. Twistshifters also have fewer moving parts, so they are a little more reliable and can be taken apart and serviced. The internals of triggershifters consist of lots of tiny parts, which were originally assembled by a huge triggershifter-making machine, and are too fiddly to fit by hand. STi shifters are common on almost all road bikes now.
Occasionally, you will still come across an old-style mountain bike thumbshifter – a single lever that sits on top of the bars; you push it forward to draw cable through and pull back to release cable. Some of these, like old XTII seven-speed thumbshifters, have a capacity to generate misty-eyed moments of tender memory in mechanics. They also work well, performing a simple task in a simple way, without needing exotic materials or computer-aided design. The levers were big and chunky so they could be easily operated with frozen hands . . . with so many advantages, they obviously had to go!
Triggershifters use two separate levers to change cable tension
With twistshifters, rotating the grip changes the cable tension
Shifters are either separate from the brake lever or part of the same unit. They work the same whether or not they are connected. If you are fitting a combination unit, fit the shifter as if it was separate, then go to the brake chapter for the brake procedure.
Combination units are slightly lighter because brake and gear levers share a clamp, but the positions of the brake and gear levers obviously cannot be adjusted separately.
Having combined brake and gear units also forces you to use the brake system specific to that manufacturer: for example, a Shimano XT combined brake and gear lever will be compatible only with Shimano hydraulic brakes.
Whichever type you have, remember that you are constantly working the shifter back and forth.
The ratcheting mechanism inside, which holds the shifter in your chosen gear, will inevitably wear, so expect to have to replace your shifters every couple of years. The first signs are usually that your shifter fails to stay in your chosen gear, allowing the chain to slip back into the next smallest chainring or sprocket. You’ll feel this start to happen first in the gears you use most often.
Whichever type of shifter you have, the derailleur adjustment works in the same way, so use this section to fit your cable or new shifter, clamp the new cable onto the relevant derailleur, then go to the derailleur adjustment section to tune your gears.
Source : BIKE MAINTENANCE TIPS, TRICKS & TECHNIQUES
See also bike maintenance tips, tricks and techniques “The importance of cleaning cables and searching out hidden grime”