Version control is how you can ensure that you can recall older versions of a file when you need them. A version control system records changes to one or more files and lets you easily recall any older version you want.
In the previous chapter, you learned about the concept of Infrastructure as Code. A Version Control system can act as the foundation for Infrastructure as Code. Everything you do in your infrastructure, you can capture it in scripts, configuration files and definition files and check them into a VC such as Git.
In this chapter, I explain the essentials of Git, which is the most popular version control system today.
In addition to Git itself, I also explain how to use GitHub, a popular Git “repository”. GitHub is a website to which you can upload your Git repository, the goal being easier collaboration with other people working on the same project.
Version control (VC) is mostly used for development proposes. However, there’s no reason why you can’t use it to maintain infrastructure related code as well. VC allows you to revert files back to older versions compare changes between versions, and find out who modified a piece of code. In a nutshell, you can recover quickly when you make mistakes, while paying very little in terms of overhead.
Version Control systems come in three broad flavors:
Local version control systems: These are purely ...