Chapter 3. Looking Around: Investigating Your Git Repository

Image

You ready to do some digging, Sherlock? As you continue to work in Git, you’ll create branches, make commits, and merge your work back into the integration branches. Each commit represents a step forward, and the commit history represents how you got there. Every so often, you might want to look back to see how you got to where you are, or perhaps if two branches have diverged from one another. We’ll start this chapter by showing you how Git can help you visualize your commit history.

Seeing your commit history is one thing—but Git can also help you see how your repository changed. Recall that commits represent changes, and branches represent a series of changes. How do you know what’s changed—between commits, between branches, or even between your working directory, the index, and the object database? That’s the other topic of this chapter.

Together, we will get to do some seriously interesting Git detective work. Come on, let’s level up those investigative skills!

Brigitte’s on a mission

Image

Allow us to introduce you to Brigitte. Brigitte, after a much-needed vacation, is in the market for a new job. She needs a resume, and knowing that she’ll probably go through a few iterations, she created a repository to work ...

Get Head First Git now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.