You’re now the proud owner of a Git repository. You’ve successfully added a single file into it. You can view the contents of your repository. It’s now time to dive a little deeper into how to update and keep track of changes that you make to files in your repository. This is clearly one of the most important features of any version control system!
In this chapter, you’ll create a new repository and then add files by using git add and git commit. You’ll learn about the git diff command, which will help you keep track of what you’ve changed in your repository as you’re working. You’ll then dive into the staging area, one of the special features of Git that enables you to commit parts of your changes into the repository. This is a use case that comes up often, and Git’s support for this is worth learning. Finally, you’ll see how Git GUI provides these same operations.
In this chapter, you’ll be working in a new repository in which you’ll build a simple program that adds two numbers.
Let’s make an entirely new repository and put one file in it.