Focus: Empowering Students with Version Control & Modern Git Workflows
Think of Version Control as a time machine for your project files.
Like saving your game before a difficult boss fight. If you lose, you do not start from the beginning: you reload from your last save point.
Tracks every edit you make, allowing you to seamlessly restore previous versions of a document if a paragraph is accidentally deleted.
It is the ultimate Undo for an entire project structure, tracking not just one file, but thousands of files simultaneously and safely.
Created in 2005 by Linus Torvalds
Git tracks changes in your code over time, allowing you to "save" stable versions of your work and travel back if something breaks.
The journey of how Git became the global industry baseline.
The Linux kernel project relies on BitKeeper, a proprietary version control tool.
The BitKeeper license is revoked; Linus Torvalds starts building Git.
Git is stable enough to manage official Linux Kernel releases.
Git 1.0 is officially released to the public.
The global standard for software engineering across the tech industry.
Understanding the difference between the engine and the ecosystem:
| Feature | Git (The Tool) | GitHub (The Service) |
|---|---|---|
| Definition | Software locally installed on your PC. | A cloud-based platform for repository hosting. |
| Main Job | Tracks changes in local files and codebases. | Stores, hosts, and shares code online. |
| UI | Command Line Interface (CLI) driven. | Web-based Graphical User Interface (GUI). |
| Network | Works completely offline. | Requires internet connectivity. |
Metaphor: Think of Git as the engine of a car and GitHub as the chassis and dashboard.
While GitHub is the clear industry leader, alternative ecosystems leverage the core power of Git:
The global hub for open-source development, social coding, actions, and massive community ecosystems. Founded in 2008 and acquired by Microsoft in 2018 for $7.5 Billion.
A complete DevOps platform highly favored for enterprise self-hosting environments and robust built-in CI/CD deployment pipelines.
Atlassian's repository platform offering native integration with Jira and Trello, popular in corporate business environments.
A Repository (Repo) functions like a smart project folder, keeping track of every single file along with its complete, unalterable revision history.
Stored securely directly on your individual PC.
Hosted in the cloud via service environments like GitHub.
The foundational command-line interface tools you need to manage local code histories:
| Command | Action |
|---|---|
| git init | Initializes a brand-new, empty local Git repository inside a folder. |
| git add <file> | Stages specific local changes, prepping them to be saved in the next commit. |
| git commit -m "msg" | Permanently snapshots your staged modifications directly into local history. |
| git push | Uploads all your newly recorded local commits up to a remote cloud repo. |
| git pull | Fetches and downloads all incoming modifications from the remote server to your PC. |
The cyclical path code takes from your initial local keystroke up to a live server deployment:
Where you actively write and edit files on your computer.
The preparation zone where you bundle specific files.
The on-device database storing permanent snapshots.
The shared cloud environment updated via push.
When writing commit messages, developers use structured layouts to maintain a clean history. A standardized commit message contains a mandatory header describing the exact nature of the modification.
Type: Dictates the intent of the change.
A branch is a lightweight, independent line of development. It functions as a safe, isolated sandbox where you can write features or fix bugs without altering the stable codebase of others.
| Command | Action |
|---|---|
| git branch <name> | Creates a new branch pointer at your current commit. |
| git checkout <name> | Switches your working directory to target branch (or use modern git switch). |
| git checkout -b <name> | Shorthand to create the branch and switch immediately. |
Contains the stable release code. Direct commits are blocked; changes are integrated solely via vetted Pull Requests.
The main development sandbox. Serves as the primary staging candidate branch before compiling production releases.
Created off dev for individual tasks (e.g., feature/login) and merged back via Pull Request.
Once a feature is finished, it must be integrated into the main pipeline using one of three options:
Combines independent history paths together by creating a dedicated "Merge Commit". Safe, non-destructive, and retains the exact timeline context.
Re-writes history by moving your feature commits sequentially to the absolute tip of the target base branch. Results in a clean, linear project history.
Condenses an entire long sequence of incremental feature branch commits down into one clean commit before applying it to the main branch.
A merge conflict occurs when Git cannot automatically resolve file changes because two separate branches edited the exact same line of code. This is commonly referred to as the "Clash of Code".
When a conflict happens, Git explicitly isolates the problematic area directly inside your source file using structural markers:
To clear a conflict, you must choose which logic to prioritize:
Discards incoming modifications, keeping your local version of the code.
Discards your local version, applying the code changes sent by your teammates.
Combines both distinct blocks of code when both execution paths are necessary.
If you are actively on a feature branch and execute a merge command with main, the code inside main is treated as the Incoming change.
The step-by-step loop for professional, open-source team contributions:
Generate a unique branch named feat/ui based off the latest dev update.
Build out your code solution and save your milestones locally.
Propose changes by launching a Pull Request tracking into dev.
Fix conflict warnings and iterate based on team code reviews.
Approved feature code is merged directly into the live ecosystem.
Put theory into practice by contributing to the official KUCC directory:
Open the official workshop repo via kuosc-git-workshop.netlify.app
Tap the Star button to support the community.
Select the Fork utility button to clone your own editable copy directly into your personal account profile.
Open the filw, locate the EDIT ME line, and append your name to the file list.
Commit your configuration change and push it directly up to your remote fork repository.
Issue a Pull Request back to the core repository to finalize your contribution!
Thank you for participating in the KUCC Masterclass!