Chapter 7. Committing parts of changes

The Git staging area, introduced in the previous chapter, is a powerful but, at the same time, confusing feature of Git. This chapter builds on what you’ve learned about the staging area, helping you to understand it better.

The staging area is used to add, delete, and rename files before they are committed into the repository. Any change to the repository goes through the staging area, which means you must come to grips with it. The commands that manipulate the staging area include git add, git rm, git mv, and git reset.

The staging area also provides the ability to commit parts of files to the repository. If you add debugging code or print statements, and don’t want to commit these into the repository, ...

Get Learn Git in a Month of Lunches now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.