Git & Project Workflow
Lesson opener
In one line: Version control and a clean folder habit - required on course roadmaps Python and data paths.
Why it matters: This shows up at work when you need to version control and a clean folder habit - required on course roadmaps Python and data paths..
Before this lesson: Power BI install
Before you start
| Resource | Link |
|---|---|
| Previous | Power BI install |
| Next | Organising an analysis project |
| External | Full Git & GitHub course |
Want the full course? Start at git1 — Why Git exists for install through CI/CD. This page is a 15-minute shortcut for the setup guide.
What you will learn
Version control and a clean folder habit — required on course roadmaps Python and data paths.
Tutorial 1 — Why Git for learners
| Without Git | With Git |
|---|---|
report_final_v3.xlsx | git commit with message |
| Lost changes | git log to see history |
| Fear of breaking code | git checkout / branches to experiment |
Tutorial 2 — Install Git
- Download Git for Windows.
- Install with default options.
- Verify:
git --versionTutorial 3 — First repo (this lab)
In a terminal, cd into your clone of this lab (the folder that contains docs/, data/, and exercises/), then:
git status
git add docs/ data/ exercises/
git commit -m "Add practice work from learning session"Never commit: passwords, .env, large .pbix with secrets, personal API keys.
Tutorial 4 — Folder discipline
| Folder | Purpose |
|---|---|
data/ | Source CSVs (read-only copies) |
outputs/ | Your charts, .pbix, exports |
exercises/answers/ | Written answers, SQL scripts |
notebooks/ | Jupyter work |
scripts/ | Reusable Python |
Also cover
- Commit messages that describe why
.gitignoreforoutputs/*.tmp,.venv/- Difference: Git vs GitHub (local vs remote backup)
Essential commands
| Command / action | What it does |
|---|---|
git status | See changed files |
git add file | Stage a file for commit |
git commit -m "msg" | Save snapshot locally |
git log --oneline | View history |
git diff | See unstaged changes |
Practice
Do this now: Initialize or use existing git repo; make one commit with a practice file in exercises/answers/. Add .gitignore entry for .venv/ if you use venv.
Teacher walkthrough: 15-minute Git safety net
All figures illustrative.
Step 1 — Install Git; git --version.
Step 2 — Configure name/email.
Step 3 — Init or clone the lab; ensure .gitignore exists.
Step 4 — First commit of a tiny note file; optional remote later (git for depth).
Failure example: committed answers with API keys
Symptom: Secret in GitHub; scanners email you.
Diagnosis: Shortcut workflow skipped ignore rules.
Correction: Remove file; rotate key; add ignore; use full Git course undo lessons if history rewrite needed.
Validation: Fresh clone has no secrets.
Guided practice
When do you stop after this setup lesson vs continue to the full Git course?
Complete solution: Stop when you only need local commits for lab homework; continue to git1 for branches, PRs, and CI.
Independent practice
Acceptance criteria:
git --versionworks.- Identity configured.
- At least one local commit in the lab folder.
- Know the link to the full Git course for collaboration.
Common mistakes
- Thinking this 15-minute lesson replaces team PR skills.
- Init in the user home directory.
- No
.gitignorefor env files.
Checklist
- [ ]
git --versionworks - [ ] I made at least one meaningful commit
- [ ] I know what not to commit (secrets)
- [ ] Continue to Excel