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
EasyInitialize 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 mainConfigure 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" > .gitignoreCheck repository status in short format:
git status --shortTry 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