Chapter 8. Source Control with Git
So far in this book, weâve shown you lots of ways to add automation to your toolbox, whether via scripting languages like Python (see ChapterÂ 4) or via templating languages like Jinja (see ChapterÂ 6). The increased use of Python-based scripts or Jinja templates means that managing these artifacts (and by artifacts we mean the files that make up these scripts, templates, and other automation tools youâre employing) is very important. In particular, managing the changes to these artifacts has significant value (weâll explain why shortly).
In this chapter, weâre going to show you how to use a source control toolâthat is, a tool that is designed to manage the artifacts youâre creating and using in your network automation processes. The use of a source control tool lets you avoid messy and error-prone approaches like appending date- and timestamps to the end of filenames, and keeps you from running into accidentally deleted or overwritten files.
To start things out, letâs take a closer look at the idea of source control. Weâre going to keep the discussion fairly generic for now; weâll delve into a specific source control tool known as Git later in the chapter. The generic qualities discussed in the next section are not specific to any particular source control tool, however.
Use Cases for Source Control
Simply put, source control is a way of tracking files and the changes made to those files over time (source control is also known ...