Stage 2 · Lesson 3 of 8
What to commit and .gitignore
A should hold your source code and the files needed to build it. It should not hold what your tools generate, and it must never hold secrets. A .gitignore file lists patterns for , ones should not track.
Typical entries are virtual environments and node_modules, build output such as bin/, build/ or __pycache__/, editor folders, and .env files holding . Add it in the first commit, because .gitignore does not untrack a file Git already follows; for that you need git rm --cached.
The expensive mistake is committing a password or key. Removing it in a later commit still leaves it in the history, so you must revoke the key (cancel it and make a new one). keeps ready-made .gitignore templates for each language.
A question to check yourself, an AI practice session and 1 cheat sheet entry come when you add the roadmap to your account. Add it
Resources for this stage
Start with· follow one of these
- CourseFreeThe Missing Semester of Your CS Education
MIT · Beginner
MIT lectures on dev tools; the shell, shell tools and version control lectures are enough
- GitHub repoFreeGitHub Skills: Introduction to GitHub
GitHub · Beginner
Free one-hour exercise: branch, commit, open and merge a pull request