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
BeginnerInitialize 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
ls
This lesson includes a short quiz. Start the lesson to answer it and track your progress.
All lessons in Version Control
2Getting Started
Initialize A RepositoryThe .git FolderConfigure Your IdentityGit StatusRecap - First Repo8Merging
What Is A MergeFast-Forward MergeThree-Way MergeMerge ConflictsResolve A ConflictRecap - Merge Master11Feature Branch Project
Project OverviewInitialize Main3Tracking Changes
The Staging AreaGit AddGit CommitModifying A Tracked FileGit LogRecap - First Commits6Recipe Site Project
Project OverviewInitialize And Ignore