4.1 Adding Files
You’re constantly adding new files and making changes to your repository’s
contents. git add fills both of these
roles. Just give it the name of a file or the files you want to add, and Git
stages the changes to commit.
Before we proceed, there is a little terminology to clear up. Staged changes are simply changes in your working tree that you want to tell your repository about. When you stage a change, it updates what Git refers to as its index. A lot of people, myself included, refer to it as the staging area.
The staging area is just that, a place where you can set up commits prior to committing to your repository.
“But isn’t this double the amount of work? Why can’t I just commit?”
In a lot of cases, yes, it is double ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access