Git and GitHub Basics · Course lab · about 150 minutes · 6 tasks · marked out of 100, pass at 60
Your best project on GitHub, with a history a stranger can read
The situation
You have a project — any project, even a single-page site — that lives in a folder with copies named final, final2 and final-REAL. By the end of this lab it has a clean history, a README a non-coder can follow, a public home on GitHub with nothing sensitive in it, and you have rehearsed the whole team motion — branch, conflict, pull request — alone.
What you'll be able to show
- Commit in small, honest steps with messages a stranger can judge
- Recover from every common mistake without fear
- Publish a project with a README whose instructions actually work
- Rehearse branches, a deliberate conflict and a pull request
What you need
- git installed, and a GitHub account
- One real project of yours
- A second, empty folder for the clone test
Tasks
-
1Init and three honest commitsInside the project, git init, configure your name and email, and make three commits: the initial one, then two real small changes, each with an imperative message that says what and why.A correct result: git log --oneline shows three commits whose messages a stranger could judge.
-
2Two unrelated changes, two commitsMake two unrelated changes (fix something small; add something small). Use git status and git diff to see both, then stage and commit them as two separate commits. Add a sensible .gitignore.A correct result: Two commits, each containing only its own change; a .gitignore that excludes secrets, dependencies and build output.
-
3Recovery drillsDeliberately: ruin a file and restore it; stage then unstage; amend a commit message; retrieve one file's version from two commits back; make a silly commit and git revert it. Note the command for each.A correct result: Five recoveries with their commands, and the log showing the revert.
-
4Publish, README, clone testPush the project to a new GitHub repo. Write the three-paragraph README (what it is, how to run it, what it does not do). Inspect every file on the website as a stranger would — nothing sensitive. Then clone it into the empty folder and run it from the clone.A correct result: A public repo URL, a README, and the project running from a fresh clone.
-
5Branch, conflict, pull request — aloneCreate a branch and commit a change to a specific line. Switch to main and commit a different change to the same line. Merge and resolve the conflict, keeping the best of both. Then push a branch and open, describe and merge a pull request on your own repo through the website.A correct result: A resolved conflict in the log, and a merged pull request on GitHub.
-
6The audit and the cardAudit your GitHub as a stranger: README quality, message quality, activity honesty, no secrets. Fix the weakest item. Write your personal git checklist card in your own words, and set a weekly reminder to push what you build.A correct result: The audit with one fix made, the card, and the reminder set.
What to hand in
The repo URL, the output of git log --oneline, the recovery notes, the merged pull request link, the audit with its fix, and the checklist card.
How it is marked
| Criterion | Points |
|---|---|
| Commits are small, separate and well described | 20 |
| .gitignore is sensible and nothing sensitive was pushed | 15 |
| All five recovery drills done and recorded | 15 |
| README works from a fresh clone | 20 |
| Conflict resolved and pull request merged | 20 |
| Audit done, fix made, card written | 10 |
| Total · pass at 60 | 100 |
صورتحال
آپ کے پاس ایک project ہے — کوئی بھی، چاہے ایک صفحے کی site — جو ایک folder میں final، final2 اور final-REAL نام کی copies کے ساتھ رہتا ہے۔ اس lab کے آخر تک اس کی صاف history ہو گی، ایک README جس پر غیر coder عمل کر سکے، GitHub پر ایک عوامی گھر جس میں کچھ حساس نہ ہو، اور آپ نے پوری team کی حرکت — branch، conflict، pull request — اکیلے مشق کی ہو گی۔
آپ کیا دکھا سکیں گے
- چھوٹے، ایماندار steps میں commit کرنا ایسے messages کے ساتھ جنہیں اجنبی پرکھ سکے
- ہر عام غلطی سے بغیر ڈر کے واپس آنا
- ایسے README کے ساتھ project شائع کرنا جس کی ہدایات واقعی کام کریں
- branches، جان بوجھ کر conflict اور pull request کی مشق کرنا
آپ کو کیا چاہیے
- git installed، اور ایک GitHub account
- آپ کا ایک حقیقی project
- clone کے test کے لیے ایک دوسرا، خالی folder
کام
-
1init اور تین ایماندار commitsproject کے اندر git init کریں، اپنا نام اور email configure کریں، اور تین commits کریں: ابتدائی، پھر دو حقیقی چھوٹی تبدیلیاں، ہر ایک ایسے imperative message کے ساتھ جو بتائے کیا اور کیوں۔درست نتیجہ: git log --oneline تین commits دکھائے جن کے messages اجنبی پرکھ سکے۔
-
2دو غیر متعلقہ تبدیلیاں، دو commitsدو غیر متعلقہ تبدیلیاں کریں (کچھ چھوٹا ٹھیک کریں؛ کچھ چھوٹا شامل کریں)۔ git status اور git diff سے دونوں دیکھیں، پھر انہیں دو الگ commits کے طور پر stage اور commit کریں۔ ایک سمجھ دار .gitignore شامل کریں۔درست نتیجہ: دو commits، ہر ایک میں صرف اپنی تبدیلی؛ ایک .gitignore جو secrets، dependencies اور build output خارج کرے۔
-
3recovery کی مشقیںجان بوجھ کر: ایک file خراب کریں اور بحال کریں؛ stage کریں پھر unstage؛ commit message amend کریں؛ دو commits پیچھے سے ایک file کا نسخہ واپس لائیں؛ ایک بے تکا commit کریں اور git revert کریں۔ ہر ایک کی command نوٹ کریں۔درست نتیجہ: پانچ recoveries ان کی commands کے ساتھ، اور log جس میں revert نظر آئے۔
-
4شائع کریں، README، clone کا testproject کو ایک نئے GitHub repo پر push کریں۔ تین paragraph کا README لکھیں (یہ کیا ہے، کیسے چلائیں، کیا نہیں کرتا)۔ website پر ہر file اجنبی کی نظر سے دیکھیں — کچھ حساس نہ ہو۔ پھر اسے خالی folder میں clone کریں اور clone سے چلائیں۔درست نتیجہ: ایک public repo URL، ایک README، اور نئے clone سے چلتا ہوا project۔
-
5branch، conflict، pull request — اکیلےایک branch بنائیں اور کسی مخصوص line میں تبدیلی commit کریں۔ main پر جائیں اور اسی line میں مختلف تبدیلی commit کریں۔ merge کریں اور conflict حل کریں، دونوں کا بہترین رکھتے ہوئے۔ پھر ایک branch push کریں اور اپنے ہی repo پر website سے pull request کھولیں، بیان لکھیں اور merge کریں۔درست نتیجہ: log میں حل شدہ conflict، اور GitHub پر merge شدہ pull request۔
-
6جائزہ اور cardاجنبی کی نظر سے اپنے GitHub کا جائزہ لیں: README کا معیار، messages کا معیار، activity کی ایمانداری، کوئی secrets نہیں۔ سب سے کمزور چیز ٹھیک کریں۔ اپنے الفاظ میں اپنا ذاتی git checklist card لکھیں، اور جو بنائیں اسے push کرنے کی ہفتہ وار یاد دہانی لگائیں۔درست نتیجہ: ایک fix کے ساتھ جائزہ، card، اور لگائی ہوئی یاد دہانی۔
کیا جمع کروانا ہے
repo کا URL، git log --oneline کا output، recovery کے notes، merge شدہ pull request کا link، fix کے ساتھ جائزہ، اور checklist card۔
نمبر کیسے ملیں گے
| معیار | نمبر |
|---|---|
| commits چھوٹے، الگ اور اچھی طرح بیان کیے گئے ہیں | 20 |
| .gitignore سمجھ دار ہے اور کچھ حساس push نہیں ہوا | 15 |
| پانچوں recovery مشقیں ہوئیں اور درج ہیں | 15 |
| README نئے clone سے کام کرتا ہے | 20 |
| conflict حل ہوا اور pull request merge ہوا | 20 |
| جائزہ ہوا، fix ہوا، card لکھا گیا | 10 |
| کل · پاس 60 | 100 |
Hand in your lab
Create a free BvLogic ID to hand in your lab, get it marked, and have it on your certificate.
Create your BvLogic IDAlready have one? Sign in and this course will be added to it.