Commit or Ignore Sorter
Run the Commit or Ignore Sorter MicroSim Fullscreen
About This MicroSim
Every robot project folder holds two kinds of files.
Some files are your real work, like main.py and config.py. You want git to save them.
Other files should never be saved. Some hold secrets, like your WiFi password.
Others are junk files that your computer or Python makes on its own.
The .gitignore file tells git which files to skip.
In this MicroSim you sort ten files from a robot project into two bins:
- Commit to git (green) — files that belong in the repository.
- Add to .gitignore (red) — files git should skip.
After each drop, the card gets a green check or a red X, and the feedback panel tells you why.
The dark box on the right builds a live .gitignore file from everything in the red bin.
For notes.pyc it writes the pattern *.pyc, which skips every compiled Python file at once.
One card, heading_log.csv, is a discussion card. Either bin is fine, and the feedback explains when each choice makes sense.
How to Use
- Drag a file card from the pile into the green bin or the red bin.
- Read the feedback. If you see a red X, drag the card to the other bin.
- No mouse? Click a card (or use the Up and Down arrow keys) and press Commit selected or Add selected to .gitignore. The C and I keys work too.
- Press Check All to color every sorted card and count what is left.
- Press Show Answers to see the answer key, or Reset to start over.
Try this challenge: Get 10 out of 10. Then compare your preview with the .gitignore in
Chapter 10.
Which line protects your WiFi password?
Iframe Embed Code
You can add this MicroSim to any web page by adding this to your HTML:
1 2 3 4 | |
Lesson Plan
Learning Objective
Students will classify robot project files as belonging in version control or in .gitignore, and will explain the reason for each decision using the ideas of secrets, rebuilt files, and shared hardware facts (Bloom's Taxonomy: Understand).
Grade Level
Grades 8–12
Duration
10–15 minutes
Prerequisites
- Git basics (repository, commit) from Chapter 5: Data Structures, Modular Programming, and Version Control.
- The config, secrets, and
.gitignorefile patterns in Chapter 10. - Awareness that
secrets.pyholds the WiFi SSID and password used to connect the robot.
Activities
- Cold sort (4 min). Students sort all ten cards without reading the chapter again, writing down their reasoning for any card they hesitate on. The immediate feedback supports self-correction.
- Categorize the reasons (4 min). In pairs, students group the ignored files by reason: secret (
secrets.py), rebuilt automatically (__pycache__/,notes.pyc), and operating-system clutter (.DS_Store). They then state the rule for committed files: source code, configuration that is safe to share, documentation, and libraries the code imports. - Discussion card (3 min). The class debates where
heading_log.csvbelongs. Prompt: "When would a data log be private or too large to commit?" - Transfer (3 min). Students open their own project folder, list every file, and write the
.gitignorethey need, then check thatsecrets.pyis on the first line.
Assessment
- Formative: Watch for students who place
config.pyin the red bin. Ask them to name what is inside it (pin numbers and tuning constants) and whether a stranger could misuse that information. - Exit ticket: "A classmate committed
secrets.pylast week and then added it to.gitignoretoday. Is the password safe now? What must they do?" (No — it remains in git history; they must change the WiFi password.) - Rubric (4-point): Exemplary — 10 of 10 on the first attempt and a correct reason for every file, including the history problem for committed secrets. Proficient — 10 of 10 after at most two corrections, with correct reasons for the secret and rebuilt-file cases. Developing — correct sorting with feedback but reasons are vague ("it is not needed"). Beginning — commits
secrets.pyor ignores source code without recognizing the problem.
References
- Chapter 10: Robot Behaviors and Autonomous Navigation — the config, secrets, and
.gitignorepatterns this sim practices. - gitignore documentation — the official Git reference for
.gitignorepatterns such as*.pycand__pycache__/. - Ignoring files (GitHub Docs) — how to create a
.gitignorefile for a repository. - Removing sensitive data from a repository (GitHub Docs) — why a committed secret stays in history and must be changed.
- "Compiled" Python files — Python tutorial section on
__pycache__and.pycfiles. - .DS_Store — Wikipedia article on the hidden folder file that macOS creates.