CBSE 2026 results are out, Mukul scored a perfect 100/100 in Computer ScienceSee all toppers →

KwickAcademy Python · 8 min · free

Sharing Your Code: Version Control Basics

8 min4 KwickClipsFull text belowFree
Kajal Ma'am (MCA), teaching since 2004Remembered in this browser

Learn version control with Git: why it exists, commits, going back in history, and sharing code on GitHub with push, clone and pull.

On screen in this lesson

The problem without it

project_final.py, project_final2.py, real_final.py
No idea what changed, or when
Friends email files and overwrite each other
A laptop crash loses everything

What is version control?

A system that records every change to your files
You can see who changed what, and why
You can go back to any older version
Git is the most popular one, and it is free

Words to know

WordMeaningEveryday example
Repositoryfolder + historya diary of changes
Commitone save pointa game checkpoint
Branchown line of worka rough notebook
Remotea copy onlinea cloud backup

Pause and predict

You edit marks.py and grade.py
You run git add marks.py only, then commit
Is the change in grade.py saved? No!
Only files you add go into the commit

Good commit habits

Commit small, one change at a time
Write a clear message: Fix grade for 75 marks
Commit working code, test it first
Never commit passwords or secret keys

What is GitHub?

A website that stores Git repositories online
Git is the tool; GitHub is a place to host it
Public: anyone can see; private: only people you allow
A free account is enough for students

Quick answers

What is a commit?

One save point in your project history, like a checkpoint in a video game.

What is the difference between Git and GitHub?

Git is the tool on your computer; GitHub is a website that stores repositories online.

KwickClips from this lesson

Short clips, one idea each. Good for revision the night before.

The full lesson, in text

Hello students, welcome to Kwickprep. Have you ever broken a working program, and wished you could go back to yesterday? Version control lets you do exactly that. Today we will learn why it exists, and how commits work as save points. Then we will share code on GitHub, and work safely with friends.

First, look at life without version control. People make copies with names like final, final two, and real final. Soon nobody knows what changed, or when it changed. When friends send files to each other, one person's work overwrites another's. And if the laptop crashes, all the work is gone.

Version control is a system that records every change to your project files. It remembers who changed what, and a short note about why. You can go back to any older version at any time. The most popular version control tool is called Git. It is free, and it works on Windows, Mac and Linux.

Here are four words used every day with Git. A repository, or repo, is your project folder together with its full history. A commit is one save point, like a checkpoint in a video game. A branch is a separate line of work, like a rough notebook for trying ideas. A remote is a copy of the repository stored online.

These are Git commands, typed in the terminal, not in Python. The very first time, tell Git your name, and your email in the same way, with git config. Git init turns the current folder into a repository. Git status shows which files have changed. Git add picks a file to include in the next save point. Git commit saves the save point, and dash m, for message, adds a short message.

Pause and predict this edge case. You edit two files, marks dot pie and grade dot pie. You run git add on marks dot pie only, and then commit. Is the change in grade dot pie saved in that commit? No, it is not. Only the files you add go into a commit, so always check git status first.

Each commit is a save point on a timeline. The first commit adds the marks. The second commit adds the grades. The third commit prints a report card. The fourth commit sneaks in a bug. Because every save point is kept, we can undo commit four, and the code works like commit three again.

Git log, with dash dash oneline, lists the commits, newest first. The lines starting with a hash sign show an example of what it prints. Each commit has a short code, called a commit hash, and yours will be different. Git restore throws away changes you have not committed yet, so be careful. Head means your latest commit. Git revert head makes a new commit that undoes it, so nothing is deleted from history.

Here are four habits of good programmers. Commit small, one change at a time, so it is easy to undo. Write a clear message, like fix grade for seventy five marks, not just update. Run your code and tests before you commit. And never commit passwords or secret keys, because anyone who sees the history can read them.

Now, sharing your code. GitHub is a website that stores Git repositories online. Remember, Git is the tool on your computer, and GitHub is one place to keep a copy online. A public repository can be seen by anyone, and a private one only by people you allow. A free account gives you both public and private repositories, which is enough for school projects.

First, create an empty repository on the GitHub website, and copy its link. Git remote add connects your project to that link, and origin is the usual name for it. Older Git names the first branch master, so git branch dash capital M main renames it to main. Git push uploads your commits, and dash u remembers where, so next time plain git push is enough. Git clone downloads a full copy of someone's repository. Git pull brings the newest commits from online into your copy.

A few practical points about GitHub. When Git asks you to sign in, your normal account password will not work. Usually a browser window opens so you can sign in. You can also use the GitHub Desktop app, or a personal access token, which is a special long password. Add a file called read me dot m d, which explains what your project does and how to run it. Add a git ignore file, which lists files Git should never upload, like secret keys.

When friends work together, nobody should change the main branch directly. Git switch, dash c, creates a new branch called dark mode and moves you onto it. You add and commit your work there, as usual. Then you push that branch to GitHub. The main branch stays untouched and working.

Here is the safe way to work in a team. Always pull first, so you start from everyone's latest work. When your branch is ready, open a pull request on GitHub, which asks the team to merge it. A teammate reviews the changes, and can spot bugs before they reach main. Once approved, you merge, and your branch joins the main branch.

Sometimes Git cannot join the work by itself, and this is called a merge conflict. It happens when two people change the same line in different ways. Git marks both versions inside the file, between special arrow lines. You read both, keep the right code, and delete the marks. Then you add and commit, and the conflict is solved.

Let us revise what we learned today. Version control records every change, who made it, and why. A commit is a save point on a timeline, and you can always go back. GitHub stores your repository online, and you push, clone and pull to share it. In a team, work on a branch, and then open a pull request. Always pull first, ask for a review, and never commit passwords or secret keys.

Courses that teach this

CourseUnit
Programming All levels PythonProjects and Applications

Voice-over in this lesson is AI-generated. The script is written and checked by Kajal Ma'am. Boards can revise a syllabus mid-year, so confirm anything you plan around against the official board circular. Keep your passwords, OTPs and ID numbers to yourself — we never ask for them. To reach Kajal Ma'am, use the WhatsApp button; sharing your number there is how we call you back.

Free to watch, no sign-up. Live classes with Kajal Ma'am are the paid course; these lessons stay free either way.

Want a plan that actually fits your board dates?

Ask Kajal Ma'am directly, 20+ years teaching computer science. Free demo class first, no payment.

Talk to Kajal Ma'am on WhatsApp

Or see the Class 12 Computer Science course →

Studying outside India?

We coach CBSE, IGCSE & international students across the globe, one-to-one, in your local time zone.

Visit International →