Chapter Two · Core Git
Your First Repository
The chapter that turns a folder into a project with a history. One command starts it, one model explains everything that follows — a file is in one of three places — and two more commands record your first commit. By the end Sandpiper has a history you wrote on purpose.
Sandpiper is a folder. By the end of this chapter it is a project with a history, and you will have put three commits into it on purpose.
Five topics, and one of them carries more weight than the rest. The chapter starts with the command that turns a folder into a repository, which does less than people expect. Then the model this entire book rests on: a file in a repository is in one of three places, and every command you learn moves it between them. After that the loop itself — stage a change, record it — run twice until it stops feeling like ceremony. Then the two commands that tell you where you are and what you changed, and finally the part nobody teaches: how to write a commit message that is worth reading in four months.
Topics in This Chapter
git add . really means and why it deserves respect.