Skip to content
ENT208TC Industry Readiness

Git Basics

Every professional developer uses Git. You do not need to master it β€” but you need to understand what it does and why your team uses it. This page covers the minimum.

Windows:

Terminal window
winget install GitHub.cli

Or download from: cli.github.com

macOS:

Terminal window
brew install gh

Linux:

Terminal window
sudo apt install gh # Debian/Ubuntu

Authenticate:

Terminal window
gh auth login

Follow the prompts β†’ choose GitHub.com β†’ HTTPS β†’ Login with browser.

Verify:

Terminal window
gh --version

Windows: Download from git-scm.com

macOS:

Terminal window
xcode-select --install

Linux:

Terminal window
sudo apt install git

Configure:

Terminal window
git config --global user.name "Your Name"
git config --global user.email "your.email@xjtlu.edu.cn"

Authenticate:

Terminal window
gh auth login # GitHub CLI handles Git auth too

Verify:

Terminal window
git --version

Once Git is installed, you can use it with AI coding tools:

  • OpenCode Desktop β€” Standalone AI coding app with GitHub Copilot integration, multiple AI models (Claude, GPT-4o), and autonomous agent mode
  • GitHub Copilot β€” VS Code extension with inline completions and chat
  • Cursor β€” VS Code-like editor with built-in AI agent

See the full comparison: AI Coding Tools


Start here β€” 100 seconds, everything you need to know at a glance.


Version control is a system that records every change you make to your code. You can see who changed what, when, and why. You can go back to any earlier version at any time.

Without version control: one person rewrites a file, the old version is gone. Two people edit the same file at the same time, one overwrites the other. You cannot trace why something broke.

With Git: every change is saved. Every person has a full copy of the history. Conflicts are caught and merged deliberately.

Git is the industry standard. GitHub (where you store and share your code) is built on Git. Every professional team you join will use Git. AI coding tools (GitHub Copilot, Cursor, Claude Code) all integrate with Git. Learning the basics now means you speak the same language as every developer you will ever work with.


A branch is an isolated copy of your codebase where you can work safely without affecting everyone else.

Why it matters: your main branch should always contain working code. You create a new branch for each feature or fix, work on it, then merge it back when it is done and tested.

main ─────────────────────────────────────────────► (always working)
└── feature/feeding-log ──► (your work) ──► merge back

Common commands:

Terminal window
git checkout -b feature/feeding-log # create and switch to a new branch
git checkout main # switch back to main

A commit is a saved snapshot of your changes with a message describing what you did.

Why it matters: commits are the history. Your pathfinder can see exactly what you did and when. β€œI worked on the app this week” is invisible β€” a commit with a clear message is permanent evidence of your contribution.

Good commit messages:

feat: add cat profile form with name and photo upload
fix: prevent duplicate feeding entries within 10 minutes
docs: add acceptance criteria to feeding log user story

Bad commit messages:

update
changes
asdfgh

The command:

Terminal window
git add . # stage all changed files
git commit -m "feat: add feeding log form" # save the snapshot

Push sends your commits from your local machine to GitHub so the rest of the team can see your work.

Why it matters: code on your laptop only is not code your team or pathfinder can see. Push at the end of every working session.

Terminal window
git push # send commits to GitHub
git push origin feature/feeding-log # push a specific branch

Pull downloads the latest changes from GitHub to your local machine.

Why it matters: before you start working, always pull. Otherwise you are working on an old version and will get conflicts when you try to push.

Terminal window
git pull # get latest changes from GitHub

pull β†’ work β†’ commit β†’ push
  1. git pull β€” get everyone else’s latest changes
  2. Write your code
  3. git add . then git commit -m "what you did" β€” save your work
  4. git push β€” share it with the team

Repeat. That is all of it.


If you want to understand the concepts properly before using the commands, this longer walkthrough is worth it.

Can’t access YouTube? Search for β€œGit and GitHub introduction” or β€œGit explained beginners” on Bilibili or any platform you can reach β€” there are good short videos in both English and Chinese.


If your team is not yet using Git properly, fix this now. The minimum:

  1. One shared GitHub repository (created by the Technical Lead)
  2. Everyone cloned β€” git clone <repo-url>
  3. Each developer works on their own branch
  4. Merge to main only when the feature works

This is enough for your sprint. You do not need Pull Requests, Actions, or automated tests yet β€” those come later.


Git errors are normal. Common ones and what to do:

ErrorWhat it meansFix
merge conflictTwo people edited the same linesOpen the file, find the conflict markers <<<<, decide which version to keep, then commit
rejected β€” non-fast-forwardSomeone else pushed before youRun git pull first, then try git push again
nothing to commitNo changes since your last commitYou are already up to date
detached HEADYou checked out a commit directlyRun git checkout main to get back

When in doubt: do not force-push to main. Ask a teammate or search the exact error message.

This site uses anonymous analytics (Microsoft Clarity) to improve course content. No personal data is collected.
Current page
πŸ€–