CH.05 · 8 MIN · PART 1

Tell Git who you are. Once.

Every snapshot Git saves carries a name and an email, like a signature. You set them one time per computer. We also pick a default branch name and talk about main vs master.

user.nameuser.emailinit.defaultBranch

Config Builder

type, then copy

Open Git Bash first (Windows) or Terminal (macOS, Linux); the commands below are typed there. Editor is what opens when you run git commit without -m.

Fill in the boxes. The commands below update as you type. Any email works for now. When you make a GitHub account later, you can use the same one, or the private no-reply address GitHub gives you.

main vs master

why two names

The old default

For years Git named the first branch master when you ran git init.

The common default now

GitHub and most projects now start with main. Setting init.defaultBranch makes your computer match, so you never have to rename it.

Either name works. The only rule: be consistent with the repository you push to.

Practice: configure Git

hands-on

Use your own name if you like. Any text works in this practice terminal.

1

Loading

practice terminal · bash-style

Quick check

1 / 3

Pick an answer.
Git, Visually · Parts 1 and 2 · English