Using Git and GitHub:
Git is an amazingly powerful version constrol system, and GitHub is a commerical web site that implements git and serves as a repository for your software projects.

A person could probably spend a lifetime learning the ins-and-outs of git, but it's relatively easy to get started. The official documentation available from here is actually a pretty good way to get started.

In addition, here is a cheat sheet for some common git commands.