Menu
Coddy logo textTech

Initialize And Ignore

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

The first job is to turn the folder into a Git repo and set things up so build artifacts stay out of version control.

You will run git init, configure your local user identity (so commits in the next lesson have an author), and write a .gitignore that hides build.log.

After this lesson, git status --short should show the source files and the new .gitignore, but never build.log.

challenge icon

Challenge

Easy

Initialize the repository on the main branch. Configure local user as Cookbook Dev with email dev@coddy.tech. Create a .gitignore containing the single line *.log.

Then print git status --short. The expected untracked entries are listed in alphabetical order.

Cheat sheet

Initialize a Git repository on a specific branch:

git init -b main

Configure local user identity (scoped to current repo):

git config user.name "Your Name"
git config user.email "you@example.com"

Create a .gitignore to exclude files from version control:

echo "*.log" > .gitignore

Check repository status in short format:

git status --short

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