These are practical gates, not quizzes. Perform them in your separate disposable git-github-lab repository.
You may use git help and official documentation unless a gate explicitly says closed-reference. Do not follow a memorized solution script. The goal is to inspect state, choose operations deliberately, and explain what happened.
Without copying a command sequence:
- create or reset a disposable practice repository
- make two new files
- inspect the state
- stage only one file
- inspect exactly what is staged
- commit it with a useful message
- explain why the other file was excluded
- modify the committed file
- show its unstaged diff
- stage it and prove the same change moved into the staged diff
- commit it
- create an ignore rule and prove it works
- show your final history
Explain:
- working tree
- staging area/index
- commit
HEADgit diffvsgit diff --staged- why
.gitignoreis not secret-removal
You can create focused commits without blindly staging everything, and you can explain the state before and after each operation.
- start from a clean
main - create two branches from the same baseline
- make different commits on both branches
- inspect the graph and identify the branch tips
- compare branch content/history
- merge one branch into
main - predict what will happen when integrating the other branch
- perform the integration
- inspect the resulting graph
- safely delete branches that are no longer needed
Explain:
- branch vs folder copy
- branch vs commit
HEAD- merge direction
- fast-forward vs divergent/three-way merge
- what
git branch -dprotects you from in common cases
You can reason from the graph rather than guessing what a branch or merge will do.
Use a disposable GitHub repository.
- connect or clone the repository locally
- identify
origin, localmain, andorigin/main - make and push a local commit
- make a different commit through GitHub's web editor
- fetch first
- inspect the graph and the commits/diff between local and remote-tracking branches
- integrate the remote change safely
- create one local commit while also creating a different GitHub-side commit before synchronizing
- fetch and diagnose the resulting divergence
- integrate it without raw force push
- push the resolved history
Explain:
- remote
origin- local branch vs remote-tracking branch
- upstream tracking
- fetch
- pull
- push
- why a rejected push is not an instruction to force-push
You can complete and diagnose a local↔GitHub round trip while inspecting before integrating.
Use a repository you control for the full lifecycle, and use a fork-based practice repository to demonstrate external contribution setup.
- show the difference between branch, clone, and fork
- in a fork, show
originandupstream - in your own repo, open an Issue describing a small change and acceptance criteria
- create a focused branch
- inspect/stage/commit the implementation
- push the branch and open a Pull Request linked to the Issue
- inspect the PR diff as a reviewer
- receive or simulate review feedback
- update the same PR with another commit
- merge it using an appropriate merge method
- verify the linked Issue state
Explain what you would inspect before opening a PR to a project you do not own:
- contribution guide
- existing Issues/PRs
- assignment/maintainer expectations
- validation requirements
- project scope
You can use GitHub as a collaboration system rather than merely as file hosting.
Every destructive experiment must happen only in disposable work.
Demonstrate all of these:
- unstage a change while preserving the edit
- stash and restore work
- deliberately discard a throwaway uncommitted edit and explain why Git may not recover it
- amend an unpublished commit
- soft-reset an unpublished commit and explain the staged result
- revert a committed change and show that history is preserved
- deliberately displace a committed change with a controlled reset
- find that commit in reflog
- recover it using a new recovery branch
Before each risky action, state:
- what can change in the working tree
- what can change in the index
- what can happen to branch history
- whether another person could already depend on the commit
You choose recovery operations based on the state/problem instead of treating undo commands as interchangeable.
Create a throwaway repository with several meaningful commits and branches.
Then intentionally construct this situation:
mainand a feature branch diverge- both modify the same line differently
- a merge conflict occurs
- resolve the conflict and inspect the merge graph
- create a local commit and a different remote commit to produce local/remote divergence
- fetch and diagnose it before integration
- integrate it without raw force push
- create another committed change
- deliberately displace that commit in the disposable repo
- recover it with reflog + a recovery branch
- create an annotated version tag and inspect it
- inspect a basic GitHub Actions workflow and identify trigger/jobs/steps
Capture or record the relevant output from:
git status
git branch -vv
git remote -v
git log --oneline --graph --decorate --all
git reflogWrite a short report:
- what state you intentionally created
- what evidence told you what was happening
- what you predicted before each recovery step
- which operations preserved history
- which operations rewrote/moved history
- why your chosen recovery was safer than tempting alternatives
- what you would do differently in an important/shared repository
You can enter an unfamiliar-looking Git problem, inspect first, form a reasonable model, recover deliberately, and verify the result.
Passing all six gates means you are ready for the capstone.
You are not expected to remember every Git flag.
You are expected to have this response to confusion:
inspect → model the current state → predict → choose the least destructive appropriate operation → verify
That is the independence target of this course.