Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
docs(lab2): finish version control deep dive #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Uh oh!
There was an error while loading. Please reload this page.
docs(lab2): finish version control deep dive #2
Changes from all commits
a172be10cdc0f706f5a46File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing
Task1:
Part1:
PS C:\Users\minim\projects\DevOps-Intro> git rev-parse HEAD ed6695bad97a0688dbf422828ef777a21585c83d PS C:\Users\minim\projects\DevOps-Intro> PS C:\Users\minim\projects\DevOps-Intro> git cat-file -t HEAD commit PS C:\Users\minim\projects\DevOps-Intro> git cat-file -p HEAD tree 19f662aebb500cc03e122fe084440e6f26f54677 parent 66bbd4db9228bc9a4cab7439746b993749c026ab author Maximilian Mifsud Bonici m.mifsudbonici@innopolis.university 1780928663 +0300 committer Maximilian Mifsud Bonici m.mifsudbonici@innopolis.university 1780928663 +0300 gpgsig -----BEGIN SSH SIGNATURE----- U1NIU0lHAAAAAQAAADMAAAALc3NoLWVkMjU1MTkAAAAgxw+3p/4wQitUT+OINxpgId29bS rSyCevvWmeF3J6yOIAAAADZ2l0AAAAAAAAAAZzaGE1MTIAAABTAAAAC3NzaC1lZDI1NTE5 AAAAQChCJDBwDQ52s9OO2ELOMES2d0q3M8itUhNHOHZfsvrkpFrsqXuNgyck6Eq5LJlHVK mtjyl5Ptby/VbcBgf5tgw= -----END SSH SIGNATURE-----
docs: add PR template
Signed-off-by: Maximilian Mifsud Bonici m.mifsudbonici@innopolis.university PS C:\Users\minim\projects\DevOps-Intro> git cat-file -p 19f662aebb500cc03e122fe084440e6f26f54677 100644 blob 1c0a1e94b7bbdd951f456cda51af6b8484cc3cee .gitignore 100644 blob d10c04c6e7e0014f4fe883599c11747c15012d4e README.md 040000 tree 1002af013078c4a32a7d36a3394998082e2d55ff app 040000 tree 6db686e340ecdd318fa43375e26254293371942a labs 040000 tree 3f11973a71be5915539cb53313149aa319d69cb5 lectures PS C:\Users\minim\projects\DevOps-Intro> git cat-file -p 1c0a1e94b7bbdd951f456cda51af6b8484cc3cee
This .gitignore is inherited by every student fork. Anything listed here
is something a student CANNOT
git addwithout-f. So this file mustONLY contain:
(a) instructor-only paths (refs/), and
(b) machine-generated junk that NOBODY should ever commit.
Do NOT add lab DELIVERABLES here (scan reports, SBOMs, go.sum, k8s
manifests, CI workflows, Dockerfiles, playbooks, dashboards, …). Students
are told to commit those in their submission PRs — ignoring them upstream
silently breaks the lab. When in doubt, leave it OUT of this file.
── Instructor-only ─────────────────────────────────────────────
Reference submissions (dry-run worked examples). Never pushed upstream;
students never see these. This is the one path that is intentionally hidden.
refs/
── Machine-generated junk (no one commits these) ───────────────
Compiled binaries / local runtime state
app/quicknotes app/data/ /quicknotes *.exe
Vagrant runtime state (Lab 5) — the Vagrantfile IS committed; .vagrant/ is not
.vagrant/
Nix build symlinks (Lab 11) — flake.nix + flake.lock ARE committed; result is not
result result-*
Terraform state — MUST never be committed (can contain secrets)
*.tfstate *.tfstate.backup .terraform/
Python virtualenvs / caches
.venv/ pycache/ *.pyc
Editor / IDE
.vscode/ .idea/ *.swp
OS noise
.DS_Store Thumbs.db
Local agent config (not part of the course)
.claude/
NOTE: deliberately NOT ignored, because students commit them as lab evidence:
submissions/labN.md (lab reports)
.github/workflows/*.yml (Lab 3 CI)
Dockerfile, compose.yaml (Lab 6)
ansible/ (Lab 7)
monitoring/ (Lab 8)
.sbom.cdx.json, zap-.html/json, trivy-*.txt (Lab 9 scan evidence)
flake.nix, flake.lock (Lab 11)
wasm/main.go, spin.toml, go.sum (Lab 12)
Part 2:
PS C:\Users\minim\projects\DevOps-Intro> cd C:\Users\minim\projects\DevOps-Intro PS C:\Users\minim\projects\DevOps-Intro> PS C:\Users\minim\projects\DevOps-Intro> # high-level .git folder view PS C:\Users\minim\projects\DevOps-Intro> Get-ChildItem -Force .git
Mode LastWriteTime Length Name
d----- 04/06/2026 02:40 hooks d----- 04/06/2026 02:40 info d----- 04/06/2026 02:40 logs d----- 08/06/2026 17:24 objects d----- 04/06/2026 02:40 refs -a---- 08/06/2026 17:30 101 COMMIT_EDITMSG -a---- 04/06/2026 03:09 474 config -a---- 04/06/2026 02:40 73 description -a---- 04/06/2026 02:40 558 FETCH_HEAD -a---- 08/06/2026 17:30 21 HEAD -a---- 08/06/2026 17:30 3191 index -a---- 04/06/2026 02:40 112 packed-refs
PS C:\Users\minim\projects\DevOps-Intro> PS C:\Users\minim\projects\DevOps-Intro> # see what HEAD points to PS C:\Users\minim\projects\DevOps-Intro> Get-Content .git\HEAD ref: refs/heads/main PS C:\Users\minim\projects\DevOps-Intro> PS C:\Users\minim\projects\DevOps-Intro> # list local branch refs PS C:\Users\minim\projects\DevOps-Intro> Get-ChildItem .git\refs\heads
Mode LastWriteTime Length Name
d----- 04/06/2026 03:17 feature -a---- 08/06/2026 17:24 41 main
PS C:\Users\minim\projects\DevOps-Intro> PS C:\Users\minim\projects\DevOps-Intro> # show first few object subdirectories PS C:\Users\minim\projects\DevOps-Intro> Get-ChildItem .git\objects | Select-Object -First 10
Mode LastWriteTime Length Name
d----- 04/06/2026 03:17 00 d----- 04/06/2026 03:14 04 d----- 04/06/2026 02:40 0a d----- 08/06/2026 17:24 10 d----- 04/06/2026 03:14 17 d----- 08/06/2026 17:24 19 d----- 04/06/2026 03:14 1c d----- 04/06/2026 02:58 22 d----- 04/06/2026 03:02 36 d----- 04/06/2026 03:16 3e
PS C:\Users\minim\projects\DevOps-Intro> PS C:\Users\minim\projects\DevOps-Intro> # count loose objects only PS C:\Users\minim\projects\DevOps-Intro> (
Your .git folder contains the normal internal Git database: refs, objects, logs, hooks, config, and index. HEAD points to refs/heads/main, which means your working directory is currently on the main branch.
Inside .git/refs/heads, Git stores your local branch references. You have a main branch and a feature folder, which likely contains your feature/lab1 branch ref.
The .git/objects folder contains Git’s stored objects, grouped by the first two characters of their SHA hash. The count 29 means your repository currently has 29 loose Git objects, such as commits, trees, and blobs, stored individually rather than packed. Basically, Git has 29 tiny fossilized pieces of your project history sitting in its basement, because apparently version control needed archaeology.
Part 3:
PS C:\Users\minim\projects\DevOps-Intro> git switch -c feature/lab2 fatal: a branch named 'feature/lab2' already exists PS C:\Users\minim\projects\DevOps-Intro> echo "important work" > submissions/lab2.md PS C:\Users\minim\projects\DevOps-Intro> git add submissions/lab2.md PS C:\Users\minim\projects\DevOps-Intro> git commit -S -s -m "wip(lab2): start" [feature/lab2 160a3a0] wip(lab2): start 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 submissions/lab2.md PS C:\Users\minim\projects\DevOps-Intro> echo "more important work" >> submissions/lab2.md PS C:\Users\minim\projects\DevOps-Intro> git commit -S -s -am "wip(lab2): more progress" [feature/lab2 4b770a8] wip(lab2): more progress 1 file changed, 0 insertions(+), 0 deletions(-) PS C:\Users\minim\projects\DevOps-Intro> PS C:\Users\minim\projects\DevOps-Intro> # now do something stupid PS C:\Users\minim\projects\DevOps-Intro> git reset --hard HEAD~2 HEAD is now at 0a87e1c refactor: reduce prescriptiveness in GitLab CI instructions PS C:\Users\minim\projects\DevOps-Intro> PS C:\Users\minim\projects\DevOps-Intro> git status # everything is "gone" On branch feature/lab2 Untracked files: (use "git add ..." to include in what will be committed) app/data/
nothing added to commit but untracked files present (use "git add" to track) PS C:\Users\minim\projects\DevOps-Intro> git log --oneline # nothing 0a87e1c (HEAD -> feature/lab2) refactor: reduce prescriptiveness in GitLab CI instructions eaea715 feat: add GitLab CI alternative instructions to lab3 d6b6a03 Update lab2 87810a0 feat: remove old Exam Exemption Policy 1e1c32b feat: update structure 6c27ee7 feat: publish lecs 9 & 10 1826c36 feat: update lab7 3049f08 feat: publish lec8 da8f635 feat: introduce all labs and revised structure 04b174e feat: publish lab and lec #5 67f12f1 feat: publish labs 4&5, revise others 82d1989 feat: publish lab3 and lec3 3f80c83 feat: publish lec2 499f2ba feat: publish lab2 af0da89 feat: update lab1 74a8c27 Publish lab1 f0485c0 Publish lec1 31dd11b Publish README.md PS C:\Users\minim\projects\DevOps-Intro> git reflog # 🎉 your commits are still here 0a87e1c (HEAD -> feature/lab2) HEAD@{0}: reset: moving to HEAD2 4b770a8 HEAD@{1}: commit: wip(lab2): more progress 160a3a0 HEAD@{2}: commit: wip(lab2): start 0a87e1c (HEAD -> feature/lab2) HEAD@{3}: reset: moving to HEAD2 170000c HEAD@{4}: reset: moving to 170000c 170000c HEAD@{5}: reset: moving to HEAD2 c74bcba HEAD@{6}: commit: wip(lab2): more progress 3e00493 HEAD@{7}: commit: wip(lab2): start 170000c HEAD@{8}: reset: moving to HEAD2 ed6695b (origin/main, origin/HEAD, main) HEAD@{9}: checkout: moving from main to feature/lab2 ed6695b (origin/main, origin/HEAD, main) HEAD@{10}: checkout: moving from feature/lab1 to main 8b4f005 (origin/feature/lab1, feature/lab1) HEAD@{11}: checkout: moving from main to feature/lab1 ed6695b (origin/main, origin/HEAD, main) HEAD@{12}: commit: docs: add PR template 66bbd4d (upstream/main, upstream/HEAD) HEAD@{13}: checkout: moving from main to main 66bbd4d (upstream/main, upstream/HEAD) HEAD@{14}: checkout: moving from main to main 66bbd4d (upstream/main, upstream/HEAD) HEAD@{15}: checkout: moving from feature/lab1 to main 8b4f005 (origin/feature/lab1, feature/lab1) HEAD@{16}: commit: docs(lab1): start submission 0051186 HEAD@{17}: commit: docs(lab1): start submission fce2878 HEAD@{18}: commit: docs(lab1): start submission 71ab93f HEAD@{19}: commit: docs(lab1): start submission 7588701 HEAD@{20}: commit (amend): docs(lab1): start submission f650984 HEAD@{21}: commit: docs(lab1): start submission 82b4372 HEAD@{22}: commit: docs(lab1): start submission 66bbd4d (upstream/main, upstream/HEAD) HEAD@{23}: checkout: moving from main to feature/lab1 66bbd4d (upstream/main, upstream/HEAD) HEAD@{24}: clone: from github.com:MiniMaxC/DevOps-Intro.git PS C:\Users\minim\projects\DevOps-Intro> git reset --hard 0a87e1c HEAD is now at 0a87e1c refactor: reduce prescriptiveness in GitLab CI instructions PS C:\Users\minim\projects\DevOps-Intro> git reset --hard ^C PS C:\Users\minim\projects\DevOps-Intro> git reset --hard 4b770a8 HEAD is now at 4b770a8 wip(lab2): more progress PS C:\Users\minim\projects\DevOps-Intro> git status On branch feature/lab2 Untracked files: (use "git add ..." to include in what will be committed) app/data/
nothing added to commit but untracked files present (use "git add" to track)
If normal git gc ran right after the bad reset, your commits would usually still be recoverable, because Git keeps reflog entries and does not immediately delete recently unreachable objects. However, if those commits became unreachable and were later pruned, for example after reflog expiry or with an aggressive prune like git gc --prune=now, the SHA from git reflog could stop pointing to a valid object. At that point recovery would be much harder or impossible unless the commits existed on a remote, another branch, or some backup, because Git is merciful only within its tiny bureaucratic grace period.
Task 2:
PS C:\Users\minim\projects\DevOps-Intro> git reflog show feature/lab2 --oneline 0cdc0f7 (HEAD -> feature/lab2, origin/feature/lab2) feature/lab2@{0}: rebase (finish): refs/heads/feature/lab2 onto ad29f349b9d98d197a4953b2ceb146a7f08b822c 4b770a8 feature/lab2@{1}: reset: moving to 4b770a8 0a87e1c feature/lab2@{2}: reset: moving to HEAD2 4b770a8 feature/lab2@{3}: commit: wip(lab2): more progress 160a3a0 feature/lab2@{4}: commit: wip(lab2): start 0a87e1c feature/lab2@{5}: reset: moving to HEAD2 170000c feature/lab2@{6}: reset: moving to HEAD2 c74bcba feature/lab2@{7}: commit: wip(lab2): more progress 3e00493 feature/lab2@{8}: commit: wip(lab2): start 170000c feature/lab2@{9}: reset: moving to HEAD2 ed6695b (tag: v0.1.0-lab2-) feature/lab2@{10}: branch: Created from HEAD PS C:\Users\minim\projects\DevOps-Intro> $oldFeature = "4b770a8" PS C:\Users\minim\projects\DevOps-Intro> git log --oneline --graph --decorate --boundary $oldFeature origin/main -n 20
| * d50436c (upstream/s26-refactor) fix(lab12,gitignore): Spin SDK (WAGI removed in Spin 3.x); minimal student-safe gitignore | * 4705a3d fix(.gitignore): stop ignoring submissions/ | * 4082340 docs(grading,lab11,lab12): bonus labs to 4+4+2; grading rebalanced to 70-14-5-20-30 = 139% | * 7b16dc5 docs(lab10): switch deploy targets to card-free platforms — HF Spaces + Cloudflare Tunnel | * 4a05efa docs(labs): scaffold the skill — labs 5-12 stop handing students copy-paste answers | * 8387fb9 docs(lab3): scaffold the skill — students write their own CI yaml; GitLab as parallel path | * 983fba0 docs(course): rewrite README + add .gitignore for project-threaded structure | * 7914e37 docs(labs): refactor 12 labs to 6+4+2 (lab1) / 6+4+bonus (lab2-10) / 10pts (lab11-12) | * aa5aa1c docs(lectures): rewrite lec1-10 + add reading11/12 for project-threaded course | * b8fc480 feat(app): introduce QuickNotes Go service for project-threaded course |/
PS C:\Users\minim\projects\DevOps-Intro> git log --oneline --graph --decorate --all -n 20
| * d50436c (upstream/s26-refactor) fix(lab12,gitignore): Spin SDK (WAGI removed in Spin 3.x); minimal student-safe gitignore | * 4705a3d fix(.gitignore): stop ignoring submissions/ | * 4082340 docs(grading,lab11,lab12): bonus labs to 4+4+2; grading rebalanced to 70-14-5-20-30 = 139% | * 7b16dc5 docs(lab10): switch deploy targets to card-free platforms — HF Spaces + Cloudflare Tunnel | * 4a05efa docs(labs): scaffold the skill — labs 5-12 stop handing students copy-paste answers | * 8387fb9 docs(lab3): scaffold the skill — students write their own CI yaml; GitLab as parallel path | * 983fba0 docs(course): rewrite README + add .gitignore for project-threaded structure | * 7914e37 docs(labs): refactor 12 labs to 6+4+2 (lab1) / 6+4+bonus (lab2-10) / 10pts (lab11-12)
Merge vs rebase reflection
I would choose merge when working on a shared branch where preserving the exact history of how branches came together matters, especially for collaboration and audit trails. I would choose rebase for my own feature branch before opening or updating a PR, because it creates a cleaner, linear history by replaying my commits on top of the latest
main. I would avoid rebasing commits that other people are already using, because rewriting shared history is how teams discover new and exciting ways to hate Git.