Creating Your First Repository
Discover how to initialize a new Git repository and start tracking files within your project directory.
Creating Your First Repository is a free Git & GitHub Professional Workflow lesson on CoddyKit. This is lesson 3 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Git & GitHub Professional Workflow learning path, and your progress syncs across the web and the CoddyKit app. The Git & GitHub Professional Workflow course includes 4 lessons in total.
The Heart of Your Project
A repository (repo) is a folder that stores your files plus the full history of every change — so you can see who changed what, revert, and collaborate cleanly.
`git init`: Start Tracking!
Turn any folder into a Git repo with git init, run from inside the project directory. It sets up everything Git needs to start tracking.
What `git init` Creates
git init creates a hidden .git folder — Git’s brain for your project. It holds all metadata and every version of your files, so never edit it by hand.
`git status`: What's Happening?
git status is your go-to: it shows what is new, modified, staged, or untracked. Run it constantly to see exactly where your repo stands.
`git add`: Prepare for Saving
Git only saves what you tell it to. git add moves files into the staging area — your prepared snapshot for the next commit.
Let's Create a Project!
Time to try it: create a folder, run git init, add a file, and check the status. Watch how staging works in your own terminal.
mkdir my_first_repo
cd my_first_repo
git init
touch index.html
git add index.html
git statusWhat `git status` Shows Now
After those commands, git status shows index.html under Changes to be committed — it is staged and ready for its first commit.
.gitignore: What Not to Track
Some files never belong in Git: build outputs, logs, secrets. List them in a .gitignore at the repo root and Git will leave them alone.
How to Use `.gitignore`
Inside .gitignore, each line is a pattern: *.log skips all logs, /build/ skips that folder, node_modules/ skips dependencies. Ignored files vanish from git status.
Test Your Knowledge
You've learned how to start a Git repository and prepare files for tracking. Let's do a quick check!
You've Started Your First Repo!
Great start! You used git init to create a repo, learned the .git folder, checked state with git status, staged with git add, and ignored junk via .gitignore.
Learn Git & GitHub Professional Workflow with an AI tutor — free
Write and run real code in your browser, get instant help from a 24/7 AI tutor, and pick up where you left off on the web or in the app.
- Courses
- 12
- Lessons
- 48
Frequently Asked Questions
Is the “Creating Your First Repository” lesson free?
Yes — the full text of “Creating Your First Repository” is free to read here on the web. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Git & GitHub Professional Workflow course, upgrade to CoddyKit PRO. The Git & GitHub Professional Workflow course includes 4 lessons in total.
What will I learn in “Creating Your First Repository”?
Discover how to initialize a new Git repository and start tracking files within your project directory. You practise Git & GitHub Professional Workflow with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start Git & GitHub Professional Workflow?
No prior experience is required. Git & GitHub Professional Workflow on CoddyKit is structured for beginners through advanced learners, so you can start here or from the beginning and move at your own pace. This is lesson 3 of 4.
How long does the “Creating Your First Repository” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this Git & GitHub Professional Workflow lesson?
Yes. Every Git & GitHub Professional Workflow lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- Introduction to Version Control
- Installing Git & Configuration
- Creating Your First Repository
- Understanding the .gitignore File