brewly — Ch.2 · Keep junk out of git
Exercise 7 of 7
Before you start
What does not belong in a repository
Logs, build output, installed packages and secrets should never be committed. A file named .gitignore lists patterns for git to skip.
One pattern per line. notes.txt matches that file, *.tmp matches every file ending in .tmp, and build/ matches a whole folder.
Be precise: a pattern that is too broad also hides real work. Commit .gitignore so the whole team benefits.
- git status
- ignored files no longer show up here
- git add .
- stage everything that is not ignored
- git commit -m "What you did"
- commit it
You can reopen this any time with “Lesson”.
.gitignoreEdit the file, then save.
Graph
- 1354d06 Add menu pageHEAD → mainorigin/main
- 619eb3b Style the order button
- 5fc44ac Initial commit