لابات Git عملية
لابات Git بتحطك في فريق حقيقي شغال على مشروع واحد من أول commit لحد ما ترجّع production. بتعمل branches و تحل conflicts، تشتغل مع زمايلك على remote محمي، تصلّح غلطاتك من غير ما تضيّع شغل، تطلع releases، وتدوّر على الـ commit اللي كسر الدنيا بـ bisect.
هتتدرب على إيه في لابات Git؟
- Working tree و Index و Commits
- .gitignore و حماية الـ secrets
- Branches و Merge
- Merge conflicts
- Stash
- Remotes و Push و Fetch
- Rebase و Cherry-pick
- Restore و Reset و Revert
- Reflog و استرجاع الشغل
- Tags و Releases
- Hooks و Worktrees و Submodules
- Blame و Bisect
- 01Configure Git for OpsTrackابدأ اللاب
First day on the OpsTrack team: before anyone commits, Git has to know who they are and how this team starts a repository.
مبتدئ · 15 دقيقة
- 02Initialize the OpsTrack Repositoryابدأ اللاب
Put OpsTrack under version control and stage its first file — without committing anything yet.
مبتدئ · 15 دقيقة
- 03Create the First Snapshotابدأ اللاب
Record OpsTrack's first reviewable history: the README first, then the service — and keep a local secret out of it.
مبتدئ · 20 دقيقة
- 04Inspect Changed, Staged and Committed Contentابدأ اللاب
Two unrelated edits, one file each: see exactly what is in the working tree, the index and the last commit, and commit them separately.
مبتدئ · 20 دقيقة
- 05Protect Secrets and Generated Filesابدأ اللاب
A local test run left artefacts behind and someone staged the production env file. Get the secret out and make the repository keep it out.
مبتدئ · 25 دقيقة
- 06Build Atomic Commits with Selective Stagingابدأ اللاب
An endpoint and a log fix, tangled in one file overnight. Stage hunk by hunk and give reviewers two commits.
مبتدئ · 25 دقيقة
- 07Read Project Historyابدأ اللاب
Answer four questions about OpsTrack's history with evidence from Git, for the team's onboarding page.
مبتدئ · 20 دقيقة
- 08Create a Health-Check Feature Branchابدأ اللاب
Kubernetes needs a readiness probe before the staging rollout. Build it on a branch so main stays releasable while you work.
مبتدئ · 25 دقيقة
- 09Compare and Merge Completed Workابدأ اللاب
OPS-110 is approved. Review exactly what the branch changes, merge it into main, and clean up.
مبتدئ · 20 دقيقة
- 10Handle an Urgent Interruption with Stashابدأ اللاب
Half-way through metrics work, production needs a config fix now. Park your work, fix main, and pick up exactly where you left off.
مبتدئ · 25 دقيقة
- 11Resolve a Content Conflictابدأ اللاب
You and Alice changed the same line. Merge her branch, resolve the conflict to the value the team agreed, and keep the rest of her work.
مبتدئ · 25 دقيقة
- 12Resolve a Modify/Delete Conflictابدأ اللاب
Carol retired a script on main; Bob's branch still edits it. Merge Bob's work, keep the script deleted, and carry his change to where it belongs now.
مبتدئ · 25 دقيقة
- 13Compare Fast-Forward and Three-Way Mergesابدأ اللاب
Two approved branches, one team policy: fast-forward when you can, an explicit merge commit for CI changes. Predict from the graph, then integrate both.
مبتدئ · 25 دقيقة
- 14Publish OpsTrack to the Team Remoteابدأ اللاب
The platform team created an empty shared repository. Connect OpsTrack to it, publish main with tracking, and keep your private experiment private.
متوسط · 20 دقيقة
- 15Clone and Join an Existing Projectابدأ اللاب
Your workstation was reimaged and Carol has cut a release branch. Clone the team repository and set up a local release branch that tracks it.
متوسط · 20 دقيقة
- 16Fetch Before Integratingابدأ اللاب
Alice is pushing Terraform for a new region. See her work arrive, inspect it before it touches your branch, then integrate with a fast-forward only.
متوسط · 20 دقيقة
- 17Handle a Diverged Branchابدأ اللاب
You committed a replica change; Bob pushed an Ansible change first. Read the rejected push, integrate both histories, and publish without force.
متوسط · 25 دقيقة
- 18Publish a Feature for Reviewابدأ اللاب
Production alert rules go through review. Publish a branch, generate a pull request with Git itself, and answer review feedback with a follow-up commit.
متوسط · 25 دقيقة
- 19Rebase Unpublished Work onto Updated mainابدأ اللاب
Your private log-rotation branch is based on last week's main, and Alice changed the same Ansible play. Replay your commits on top of the team's main and publish a linear branch.
متوسط · 30 دقيقة
- 20Cherry-Pick an Approved Contributionابدأ اللاب
release/1.0 needs Bob's Cache-Control fix — and nothing else from his branch. Copy exactly that commit, record where it came from, and publish the release branch.
متوسط · 25 دقيقة
- 21Restore the Correct Git Layerابدأ اللاب
A messy morning: debug junk in a doc, a local tweak staged by mistake, and a deleted script. Fix each one in the layer where it lives, without a commit.
متوسط · 20 دقيقة
- 22Compare Soft, Mixed and Hard Resetابدأ اللاب
Three disposable clones, three practice commits each. Squash with --soft, uncommit with --mixed, discard with --hard — and see that the reflog still remembers.
متوسط · 30 دقيقة
- 23Revert a Shared Production Changeابدأ اللاب
Yesterday's pushed change to 32 workers ran staging out of memory, and Alice has pushed on top of it. Undo it publicly with a revert — never by rewriting main.
متوسط · 25 دقيقة
- 24Recover a Deleted Branch with the Reflogابدأ اللاب
A hasty clean-up deleted an unpushed branch with two days of work. Find its commits in the reflog, recreate the branch, and publish it before anything else goes wrong.
متوسط · 20 دقيقة
- 25Clean an Unpublished Branch with Interactive Rebaseابدأ اللاب
Five noisy commits — wip, fix typo, oops — on a private branch. Rewrite them into one feature commit and one docs commit that a reviewer can read, without losing a byte.
متوسط · 30 دقيقة
- 26Prepare Annotated Release v1.0.0ابدأ اللاب
Carol approved 1.0.0. Record the changelog, then mark exactly that commit with an annotated release tag — the object your deployment pipeline will trust.
متوسط · 20 دقيقة
- 27Publish and Verify the Release Tagابدأ اللاب
The pipeline deploys tags. Publish the release commit and the v1.0.0 tag — and only that tag — then see why a published release tag must never move.
متوسط · 15 دقيقة
- 28Apply .gitattributes and Line-Ending Consistencyابدأ اللاب
Bob committed from a Windows laptop and the smoke test now dies with bash\r. Make the repository — not each laptop — decide line endings, then normalize history from here on.
متوسط · 25 دقيقة
- 29Add a Local Pre-Commit Quality Gateابدأ اللاب
After the near miss with a secret, the team wants a shared hook that blocks secret-like values and whitespace errors before they are ever committed.
متوسط · 25 دقيقة
- 30Use Git Worktrees for Concurrent Workابدأ اللاب
Mid-way through Helm edits, Bob's commit breaks the staging probe. Fix it in a second working tree on the team's latest main — without stashing or disturbing your Helm work.
متوسط · 25 دقيقة
- 31Manage a Pinned Submoduleابدأ اللاب
The SRE runbooks live in their own repository. Include them in OpsTrack pinned to the reviewed v2.3.0, not whatever is newest, and publish the pin.
متوسط · 30 دقيقة
- 32Search History with grep, log -S and log -Gابدأ اللاب
Prepare a post-mortem: when did the connection cap appear, when did a flag die, how often did the log format change, and what did the 1.0.0 release actually contain?
متقدم · 25 دقيقة
- 33Investigate a Line with git blameابدأ اللاب
Why is HEALTH_TIMEOUT 2? A move and a whole-file re-indent hide who decided it. See through both, find the reason, and make blame skip the re-indent for the whole team.
متقدم · 25 دقيقة
- 34Find a Regression with git bisectابدأ اللاب
The config check passed at v1.0.0 and fails on main, with dozens of commits between and one that cannot even run. Let git bisect find the first bad commit, keep the evidence, and clean up.
متقدم · 30 دقيقة
- 35Reuse Conflict Resolution with git rerereابدأ اللاب
The rate-limit feature must land on release/1.1 and on main, and both conflict the same way. Resolve it once, let Git reuse your resolution, and publish both branches.
متقدم · 25 دقيقة
- 36Recover OpsTrack and Publish v1.1.1ابدأ اللاب
INC-101: since the 1.1.0 rollout, /health answers 404 and the load balancer is draining pods. Protect your own work, find the commit that broke production, ship a minimal, auditable v1.1.1, and get back to what you were doing.
متقدم · 1.5 ساعة
ليه تتعلم Git بالتطبيق العملي؟
- أغلب الناس بتستخدم Git كل يوم وبتدوّر على جوجل أول ما حاجة تبوظ. اللاب بيخليك تبوّظها وتصلّحها بإيدك.
- كل لاب بيتحقق من اللي عملته فعلًا في الـ repository وبيقولك إيه اللي لسه ناقص.
- الكورس بيخلص بـ incident كامل: تحمي شغلك، تلاقي الـ commit الغلط، وتطلع hotfix من غير ما تبوّظ شغل زمايلك.
أسئلة شائعة
اللابات مجانية؟
أيوه. سجّل واشترك في الكورس وابدأ، من غير اشتراك مدفوع.
محتاج حساب GitHub؟
لأ. كل لاب فيه repository تدريبي و remote خاص بالفريق جوه اللاب، ومفيش حاجة بتتبعت على GitHub بتاعك.
مناسبة لمبتدئ؟
أيوه. أول module بيبدأ من إعداد Git وأول commit، ومحتاج بس تعرف تتنقل في الـ terminal.