liveBook · Manning

.gitignore

As explained in Road to Kubernetes

.gitignore is a Git configuration file that specifies files and directories Git should ignore.

A .gitignore file tells Git which files and directories to leave untracked. Create it in the repository root, alongside the .git directory, before adding project files. section 2.3.2 section 2.3.1

Ignoring third-party package folders keeps recoverable dependencies out of the repository. Python projects commonly ignore venv/, while Node.js projects ignore node_modules/; requirements.txt and package.json record what can be reinstalled. section 2.3.2

Verify that ignoring works

After saving .gitignore, run git status. The ignored venv/ or node_modules/ directory should no longer appear among untracked files. If it remains, check that the file is saved and located beside .git. section 2.3.2

How Road to Kubernetes covers it

How deep it goes
Defines placement, shows practical ignore patterns, and verifies results with git status without exploring advanced pattern rules.
Examples
Uses Python venv/ and cache patterns, Node.js node_modules/ and log patterns, plus git status checks.
What it assumes
Assumes an initialized Git repository and teaches the file name, root location, ignore entries, and status-based verification.
What you can do after
Configure Git to ignore project-specific files and diagnose misplaced or unsaved .gitignore files through git status.
How it connects
Connects Git repositories with git status, virtual environments, node_modules, requirements.txt, and package.json.

Also explained in

Compare how 2 books explain .gitignore →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Road to Kubernetes. The section links point to the parts of the book it draws on.