Chapter 19. An introduction to source control with git

 

One sign of a professional toolmaker is their use of source control. Way back in the olden days of VBScript, we threw together ad hoc scripts, used them in production, and then forgot about them. But now that we’re in the world of automation and DevOps, properly maintaining our PowerShell projects is critical. For many organizations today, this task falls to git, a source control system first made popular on Linux (it was invented by Linux’s inventor, Linus Torvalds). We thought it would be helpful to provide a crash course on git fundamentals so that you can begin incorporating it into your work. As you might expect, this is a large topic, and you’ll need to devote some time to learning more than the basics. You may want to take a look at Learn Git in a Month of Lunches, by Rick Umali (Manning, 2015, www.manning.com/books/learn-git-in-a-month-of-lunches).

19.1. Why source control?

Source control is a means of keeping track of what changes have been made to a file, often including a log or documentation that indicates who made a change and why. Source control also makes it easier to know which is the latest, or more authoritative, version. Some systems require you to check out a file in order to work on it. When you’re finished, you can check it in, often with a comment about what you modified and why. While the file is checked out, only you can work with it, which may be fine for smaller teams.

19.2. What is git?

19.3. Repository basics

19.4. Using git with VS Code

19.5. Integrating with GitHub

19.6. Summary

sitemap