Version Control With Git
Every Pakistani family keeps a shijra, a paper or a memorised chain that records who is the son of whom, going back four or five generations. When a cousin marries, when a child is born, when an elder dies, the shijra i…
There is more than one way to understand this. If you have only been taught one, you have been taught less than you deserve.
There is more than one way to understand this. If you have only been taught one, you have been taught less than you deserve.
Every Pakistani family keeps a shijra, a paper or a memorised chain that records who is the son of whom, going back four or five generations. When a cousin marries, when a child is born, when an elder dies, the shijra is updated. If two people remember a name differently, the older relatives are consulted, the disagreement is settled, and the corrected version becomes the one everyone keeps. Git, the tool every working programmer uses, is exactly a shijra for code. It records every change, who made it, when, and why, and it lets two people work on the same family tree at the same time without losing each other's work.
Five words to learn. Repository, the folder Git is watching. Commit, a single saved snapshot of all your work, with a name and a message. Branch, a parallel chain of commits, like a separate copy of the family tree where you try changes safely before they enter the main book. Merge, joining a branch back into the main line. Push, sending your local commits up to GitHub so others can see them. Practitioners use these five words a hundred times a day. By the end of this lesson, so will you.
Hands on. In your Replit project from lesson one, open the shell tab. Type git init. Then git add dot. Then git commit dash m and inside quotes write, first commit, hello to nani jaan. Press enter. Git silently writes its first journal entry. Now change one word in your program, save, then run git status. Git tells you which file changed. Run git add and the filename, then git commit dash m, and a new short message describing the change. You have just made the second entry in your project's family tree. The chain has begun.
Branches are where Git stops feeling like a save button and starts feeling like a superpower. Imagine you want to try adding Punjabi greetings to your program, but you are not sure they will work. In the shell, type git checkout dash b punjabi-greetings. You are now on a separate branch. Make changes, commit. If you like the result, run git checkout main, then git merge punjabi-greetings, and the changes join the main line. If you hate the result, run git checkout main and forget the branch existed. Your main line never saw the experiment. The discipline of trying ideas on a branch and only merging the good ones is the single biggest difference between a hobbyist and a working developer.
Last step today, share your work. Make a free GitHub account if you have not already. On your repository page, copy the URL it gives you, ending in dot git. In your Replit shell, run git remote add origin and paste the URL. Then git push dash u origin main. Refresh your GitHub page. Every commit you have made is now visible online, with timestamps, messages, and the green dots that mark days you wrote code. That public page is the new resume. Pakistani recruiters in 2026 click GitHub before they click your university name. The journal you started in this hour is the journal they will read four years from now.
Estimated time: 14 min