Currently you have multiple Git branches for each Minecraft version but it can be complex to maintain differences between versions.
Stonecutter is a Java pre-processor that allows you to conditionally change code at runtime within a single project as it dynamically generates the version specific code when required.
There are already 352 mods using to name a few: Zoomify, Create Big Cannons, and Better Clouds.