3.1 Lesson Outcomes
After completing this lesson, learners will be able to:
- Explain the purpose of Git.
- Create and initialize Git repositories.
- Use basic Git commands.
- Track changes in source code.
- Push and pull project updates using Git.
3.2 Overview
Git is a distributed version control system used to manage source code and track project changes during software development. Developers use Git to collaborate, manage versions, and maintain software projects efficiently.
This lesson introduces learners to practical Git workflows and commonly used Git commands.
Git is important in:
- software development,
- collaborative programming,
- DevOps,
- cloud development,
- and project management.
Understanding Git is important because modern software projects rely heavily on version control systems.
PA0501 — Installing Git
Git must be installed before version control activities can begin.
Git Installation Activities
Learners must:
- download Git,
- install Git,
- and verify installation successfully.
Verification Command
Plain text
git –version
Practical Activity
Learners must:
- install Git,
- open Git Bash,
- and verify installation.
PA0502 — Initializing a Git Repository
A repository stores project files and version history.
Git Initialization Command
Plain text
git init
Repository Structure
Plain text
.git
older stores repository information.
Practical Activity
Learners must:
- create a project folder,
- initialize a repository,
- and verify repository creation.
PA0503 — Adding and Committing Files
Git tracks changes made to project files.
Adding Files
Plain text
git add .
Committing Changes
Plain text
git commit -m “Initial Commit”
Practical Activity
Learners must:
- create project files,
- add files to staging,
- and commit project changes.
PA0504 — Viewing Repository Status and Differences
Git provides commands to check project status and file changes.
Status Command
Plain text
git status
Difference Command
Plain text
git diff
Practical Activity
Learners must:
- check repository status,
- identify modified files,
- and compare changes.
PA0505 — Creating and Switching Branches
Branches allow independent development activities.
Create Branch
Plain text
git branch feature-branch
Switch Branch
Plain text
git checkout feature-branch
Practical Activity
Learners must:
- create branches,
- switch branches,
- and verify active branch changes.
PA0506 — Cloning and Pulling Repositories
Git allows developers to download and update repositories from remote platforms.
Clone Repository
Plain text
git clone repository-url
Pull Changes
Plain text
git pull
Practical Activity
Learners must:
- clone a repository,
- pull project updates,
- and verify downloaded files.
PA0507 — Pushing Changes to Remote Repository
Git allows local commits to be uploaded to remote repositories.
Push Command
Plain text
git push
Practical Activity
Learners must:
- commit project updates,
- push changes to remote repository,
- and verify successful upload.
3.5 Key Notes / Summary
- Git is a distributed version control system.
- Repositories store source code and project history.
- git init creates repositories.
- git add stages changes.
- git commit saves changes.
- git branch creates development branches.
- git push uploads project changes.