Not sure which is the "best", it must surely depend on your budget, development environment, resources, time, etc etc. Here some ideas, I list them in the order of preference, starting with the FREE.
- "Git" in effect creates a backup, even if strictly speaking its version control tool.
- You can create and save it on your iCloud Drive, Google Drive, Sky Drive, etc etc, of course you need to manually duplicate it on a regular basis.
- You can for sure get commercial tools to do this, do a google/wikipedia search, read some reviews.
- "Time machine" perhaps overkill, although maybe you can tweek it to focus on your projects.
- "rdist" is UNIX utility that you could setup in a "crontab" to do regular copies of files that changed, although a risky strategy.
- Just use Finder to manually duplicate the entire folder, you just need to remember to do it.