You will no doubt have heard of Git (git-scm.com—the version-control system that has collaborative sharing features at GitHub), even if you have never used it. Git is a version-control system that can be used locally on your computer, or in order to get the best out of it, the version-control repository on your computer can be synced online at GitHub. Hosting of open source code at GitHub is free, and there are paid options for closed source code. If you haven't already used a version control, this is an excellent reason to start. It is a little intimidating for newcomers, but over time, the resources and tutorials on the site have improved and perhaps one day of head-scratching awaits you. Trust me that one day I will be paid back hundredfold. The Pro Git book can be downloaded for free from the Git site at git-scm.com/book/en/v2. There is also a wonderful interactive tutorial (try.github.io) on the Git site. As a die-hard Linux enthusiast, it pains me to admit it, but I actually found learning on Windows easier because they provide a wonderful GUI to get you started (also on OS X). This does not mean that you need to use Windows or should stick to Windows; I happily dropped the GUI and went to the terminal in Linux once I'd found my feet a bit.
Finally, RStudio itself actually supports Git and GitHub, and once you've installed Git and set up your account, you can pretty much run the whole show from within RStudio itself.