Git is software that keeps close track of the changes you make to your work. The folks who wrote Linux designed and developed Git; group work on a software project is pretty much impossible without something like this.
Like R itself, Git is an open-source, command-line program. Just as RStudio was designed to provide a graphical interface for R, there are also graphical interfaces for Git. However, RStudio itself provides visual interaction for a small, useful subset of Git’s commands.
There are two levels to Git. You can use it only on your own computer. Every time you finish a chunk of work, you commit it, including a note about what you did in that chunk. This provides a record of changes and allows you to see code that was in previous versions that you might have deleted since then. At this level you have version-control software.
At the next level you create a repository for your project on GitHub.com and start pushing commits to GitHub. This gives you a backup in the cloud and allows you to share your work with others. GitHub provides a development web site for your project, with a ticket system called Issues, a way for others to suggest new code for your project called Pull Requests, and a wiki. Unless you want to make your project private, the GitHub repository is free.
There are two good introductions to using Git with RStudio. If you’re ready to grow up and use Git, you can and should read both online. First there’s the Git chapter in Hadley Wickham’s book, R Packages. Wickham is Chief Scientist at RStudio.
The other is Jenny Bryan’s Happy Git and GitHub for the useR. Happy Git is a book project that Bryan, who teaches statistics at the University of British Columbia, includes as background material for her presentations on Git; I found her online video on Git and GitHub from the 2017 RStudio Conference extremely helpful.
Full documentation on Git and GitHub, but without any reference to RStudio, is here: