ABSTRACT

A version control system tracks changes to files and helps people share those changes with each other. The most widely used version control system today is Git. This chapter describes how to perform fundamental operations using Git's original command-line interface interface. Version control works by storing a master copy of the code in a repository. Instead of editing the code directory, a working copy of the code is checked out, edited, then committed back to the repository. A local repository is located the user's own computer. A remote repository is hosted on another computer or server, like GitHub. By referring to specific Git commits, previous versions of files can be viewed, or restored. Not every file's history needs to be tracked, so some files should be ignored. By the end of the chapter a learner will be able to initialize a local Git repository, edit files and commit changes, connect to a remote repository on GitHub, explore the history of files, and specify some files to be ignored by Git.