First Commit
Part of the Version Control section of Coddy's Terminal journey — lesson 25 of 58.
The repo is initialized and the build artifact is ignored. Time to take the first snapshot.
This lesson stages every visible file in the project at once and creates a single commit named Initial site. After this, the entire starting state of the project is preserved in the history.
Challenge
EasyStage all the source files (use git add .), then create the first commit with the message Initial site.
Print the latest commit subject using git log -1 --pretty=%s.
The repo is already initialized, configured, and has a .gitignore excluding *.log.
Cheat sheet
Stage all files and create the first commit:
git add .
git commit -m "Initial site"Print the latest commit subject:
git log -1 --pretty=%sTry it yourself
git init -q -b main
git config user.name "Cookbook Dev"
git config user.email "dev@coddy.tech"
echo "*.log" > .gitignore
git status --short
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