Menu
Coddy logo textTech

Initialize Main

Part of the Version Control section of Coddy's Terminal journey — lesson 51 of 58.

Step one: turn the folder into a Git repo with a clean first commit on main.

You will run git init, configure local user identity, stage every file, and create the initial commit.

challenge icon

Challenge

Beginner

Initialize the repo on main. Configure local user as Todo Dev / todo@coddy.tech. Stage every file and commit with the message Seed todo list.

Then print the latest commit subject using git log -1 --pretty=%s.

Cheat sheet

Initialize a Git repository and make a first commit on main:

# Initialize repo with main as default branch
git init -b main

# Configure local user identity
git config user.name "Your Name"
git config user.email "you@example.com"

# Stage all files and commit
git add .
git commit -m "Initial commit"

# Print latest commit subject
git log -1 --pretty=%s

Try it yourself

Terminal
ls
quiz iconTest yourself

This lesson includes a short quiz. Start the lesson to answer it and track your progress.

All lessons in Version Control