Wednesday, October 22, 2025

Pre-Read: Version Control in Teams

 Prerequisites:

  • Basic understanding of what code is and how files are saved on a computer. If you’ve ever saved multiple versions of a document, you’re already halfway there!

What You'll Gain from This Pre-Read

  • After reading, you'll be able to:
  • Understand what version control means and why it’s essential for teamwork.
  • Explain how Git helps track changes in projects.
  • Recognize the commit–push workflow used in daily coding tasks.
  • Understand branching and how it helps teams work on different features without conflicts.
  • Use simple Git commands with confidence and clarity.

Think of this as:

  • Learning how to collaborate without chaos. You’re building the habits that make team projects organized, traceable, and error-free.

What This Pre-Read Covers

  • This pre-read will:
  • Introduce what version control is and why teams depend on it.
  • Explain how Git helps track and manage code changes.
  • Walk through the commit–push loop, the daily rhythm of developers.
  • Explore branching, one of Git’s most powerful features.
  • Share real-world examples of how teams use Git in popular projects.

Part 1: The Big Picture – Why Does This Matter?

  • Imagine working with five friends on the same group project. You each edit the same file, overwrite each other’s work, and forget which version is latest. Chaos, right? That’s what software teams faced before version control systems like Git existed.
  • Version control is like a time machine for your code. It records every change, who made it, and when — letting you travel back to any version safely. When multiple people work together, version control ensures everyone stays in sync without breaking each other’s work.

Where You’ll Use This:

Job roles:

Software Developers: Use Git daily to collaborate on code.

Data Scientists: Use Git to manage versions of notebooks, models, and datasets.

DevOps Engineers: Track infrastructure scripts and automate deployment changes.

Real products:

  • GitHub – Where millions of developers store and share code collaboratively.
  • GitLab – Used by companies for private and enterprise-level projects.
  • Bitbucket – Another tool that hosts Git repositories for teams.

What you can build:

  • Team-based coding projects that are synchronized and conflict-free.
  • Real-world open-source contributions.
  • Scalable applications with smooth teamwork and continuous updates.

Think of it like this:

  • Version control is like Google Docs for code — multiple people can work on the same file, see changes, and revert if something breaks.

Limitation:

  • Unlike Google Docs, Git doesn’t merge automatically — you sometimes have to manually fix conflicts when two people change the same line of code.

Part 2: Your Roadmap Through This Topic

Here’s what we’ll explore together:

  1. Git Basics
  • You’ll discover what Git is, how it works under the hood, and why it’s different from simply saving files on your computer.
  1. The CommitPush Loop
  • We’ll explore how developers save and share their progress using the powerful cycle of committing and pushing.
  1. Branching
  • You’ll see how teams work on multiple features or experiments at once without breaking the main code.
  1. Merging and Collaboration Tools

We’ll look at how Git brings branches back together and how tools like GitHub make teamwork smooth.

  1. Real-World Practices

We’ll connect everything to how companies and open-source teams really use Git day to day.

The journey:

  • We’ll start with the core concept of version control, learn Git’s building blocks, practice saving and sharing work, and finally understand how teams collaborate seamlessly.

Part 3: Key Terms to Listen For

Repository (Repo)

  • A folder that Git tracks. It stores your files and all the history of changes made to them.

Example:

  • Your project folder on GitHub is a “repository.”

Commit

  • A snapshot of your project at a specific point in time.

Think of it as:

  • Hitting “Save” but smarter — every commit has a message explaining what changed.

Push

  • Sending your commits from your local computer to a shared repository online (like GitHub).

In practice:

  • When you push, your teammates can now see your latest updates.

  • A separate line of development that allows you to work on new features without disturbing the main project.

Example:

  • You create a branch called feature-login to build a new login page while keeping the main code stable.

  • Combining changes from one branch into another (usually into the main branch).

Example:

  • When your feature is ready, you merge it into main to make it part of the official code.

  • A situation where Git doesn’t know which version to keep when two people edit the same line.

Example:

  • You and your teammate both change the same line of index.html — Git asks you to decide whose change stays.

Key Insight:

  • Git is not just about saving files — it’s about tracking the history of collaboration. Every term above works together to make teamwork smooth and reversible.

Part 4: Concepts in Action

  • Seeing Version Control in Action

The scenario:

  • You and your team are building a small website. Each person is responsible for a different section — one handles navigation, one styles the homepage, and another adds contact forms. Without version control, you’d constantly send files back and forth over email, unsure which copy is latest.

Our approach:

  • With Git, everyone clones the same repository, works locally, and safely merges changes when ready.

Example 1: Git Basics – Starting a Repository

Step 1: Create a folder for your project

mkdir my-website

cd my-website

Step 2: Initialize a Git repository

git init

Step 3: Add your first file

echo "Hello World" > index.html

git add index.html

Step 4: Commit your work

git commit -m "Initial commit - added homepage"


What’s happening here:

  • You just created a Git repository, told Git to track a file, and saved the first version of your project. Git now remembers this state forever.

Output/result:

  • A hidden .git folder is created — this is Git’s “brain” that stores all history.

Key takeaway:

  • Every Git project starts locally. You’re telling Git: “Track everything I do from now on.”

Example 2: Commit–Push Loop

Step 1: Make some changes

echo "Welcome to my portfolio" >> index.html

Step 2: Check which files changed

git status

Step 3: Stage and commit the changes

git add index.html

git commit -m "Updated homepage text"

Step 4: Connect to a remote repository

git remote add origin https://github.com/username/my-website.git

Step 5: Push the changes

git push -u origin main

What’s happening here:

  • You made updates locally, recorded them with a message, and sent them to GitHub where others can see them.

Result:

  • Your GitHub repo now has the latest version of your website.

Key takeaway:

  • The commit–push loop is the heartbeat of teamwork: save locally, then share globally.

Example 3: Branching in Action

Step 1: Create a new branch for your feature

git branch feature-contact-page

Step 2: Switch to the new branch

git checkout feature-contact-page

Step 3: Add your new feature

echo "Contact us at info@mywebsite.com" > contact.html

git add contact.html

git commit -m "Added contact page"

Step 4: Merge your changes back to main

git checkout main

git merge feature-contact-page

What’s happening here:

  • You created a safe workspace (branch), built your feature, and merged it back into the main project once ready.

Result:

  • The main project now includes your contact page, and your teammates’ work remains intact.

Key takeaway:

  • Branching lets teams innovate safely — no one breaks the main project while experimenting.

Part 5: Best Practices and Real-World Tips

Commit often:

  • Small, meaningful commits make it easier to track and undo mistakes.

Write clear commit messages:

  • Future-you (and teammates) will thank you for messages like "Fixed login button issue" instead of "changes".

Use branches for every feature or bug fix:

  • Keeps main code clean and stable.

Pull regularly:

  • Before you start working, pull others’ latest changes to avoid conflicts.

Resolve conflicts calmly:

  • Read the file, decide which version is correct, and commit the fix.

Real-world analogy:

  • Think of Git as your project’s diary — every change, big or small, is written down. If something goes wrong, you can flip back to yesterday’s entry.

Summary: The Power of Version Control in Teams

  • Version control transforms chaos into coordination. Instead of overwriting each other’s work, teams can build confidently, experiment freely, and recover quickly. Git gives every member a voice — every change is recorded, traceable, and reversible.
  • In today’s tech world, whether you’re building apps, analyzing data, or designing AI models, knowing Git is non-negotiable. It’s the universal language of collaboration.

Your mindset from here:

  • Don’t think of Git as just a tool — think of it as teamwork insurance.

 

Lecture Notes: Optimising Numerical Code

Lecture Notes: Optimising Numerical Code Prerequisites: Basic Python programming Understanding of NumPy arrays and vector ...