Lesson · ⏱ 6 min read

🌳 Git and GitHub: saving and sharing your work

EnglishHinglish

🏠 Real-life example

Writing an important document, people save 'report_final', 'report_final_v2', 'report_FINAL_really'. Git does this properly. Each 'commit' is a labelled save point you can go back to. GitHub is like Google Drive for code: it keeps your project online and shows recruiters what you've built.

💡 In simple words

Git is a version-control tool. It tracks every change to your files so you can see history, undo mistakes and work with others without overwriting each other's work. The basic cycle is: edit files → 'git add' (choose changes) → 'git commit' (save with a message) → 'git push' (upload to GitHub). Branches let you try something new without breaking the main version. Your public GitHub profile is often the first thing an AI hiring manager looks at.

🎬 See how it works

mainbranch: try-new-modelmerge ✓GitHubpushcommitcommit

Each dot is a commit (a save point). A branch lets you try something safely, then merge it back and push to GitHub.

🪜 Step by step

  1. Start tracking a project: git init in the folder (or clone an existing repo with git clone <url>).
  2. Save a checkpoint: git add file.py (choose what to save), then git commit -m "Add EMI calculator" (save with a message).
  3. Work safely on a branch: git switch -c new-feature. Your main code stays untouched until you merge.
  4. Share it: create a repo on GitHub and git push. Others (and recruiters) can now see your code.
  5. Write a README: what the project does, how to run it, a screenshot and results. This is what people read first.

🔑 Key terms

Commit
A saved snapshot of your project with a short message.
Repository (repo)
A project folder tracked by Git.
Branch
A separate line of work, so you can experiment safely.

👀 See it in action

bash
git init                         # start tracking this folder
git add analysis.py
git commit -m "Add sales analysis"
git push origin main             # upload to GitHub

Four commands you'll use every single day.

⚠️ Common mistakes to avoid

  • Committing secrets like API keys or passwords. Put them in a .env file and add .env to .gitignore.
  • One giant commit at the end. Commit small steps with clear messages; it tells the story of your work.
  • Uploading huge data files. Keep data out of git; share a download link or a small sample instead.

✅ Quick check

Which command creates a save point with a message?

  1. git init
  2. git commit
  3. git push
Show answer

B. git commit: commit saves a snapshot locally. push then uploads your commits to GitHub.

🙋 Questions learners ask

What's the difference between Git and GitHub?

Git is the tool on your computer that tracks versions. GitHub is a website that hosts Git repositories so you can share and collaborate.

Do recruiters really look at GitHub?

For AI roles, often yes, especially for career switchers. Two or three clean projects with good READMEs prove skills better than certificates.

📌 Remember

add → commit → push. Commit small and often, with clear messages.

📖 Words from this lesson (AI dictionary)

Learn this as part of a full course

Track your progress, take the quick checks and follow the lessons in the right order. This lesson is part of:

AI Foundations Path

Continue in the course