📘LESSON 6
3.1 Lesson Outcomes
After completing this lesson, learners will be able to:
- Explain the purpose of Git.
- Define version control and source code control.
- Explain collaboration using Git.
- Define repositories and branches.
- Explain pull requests and changes in Git.
- Use basic Git commands in software development workflows.
3.2 Overview
Modern software development requires tools that help developers track changes, collaborate efficiently, and manage source code safely. Git is one of the world’s most widely used version control systems and is commonly used in enterprise and collaborative software development environments.
This lesson introduces learners to Git and explains version control, repositories, branches, collaboration workflows, and Git commands used in source code management.
Git is widely used in:
- enterprise software development,
- web development,
- cloud platforms,
- DevOps environments,
- and collaborative programming projects.
Understanding Git is important because software developers rely on version control systems to manage code and collaborate effectively.
KT0601 — Overview of Git
Git is a distributed version control system used to track changes in source code during software development.
Git helps developers:
- manage code,
- track changes,
- collaborate,
- and maintain project history.
Features of Git
Git supports:
- collaboration,
- version tracking,
- branching,
- and source code management.
Importance of Git
Git improves:
- software development workflows,
- collaboration,
- and project management.
KT0602 — Version Control
Version control is the process of tracking and managing changes made to source code over time.
Version control systems allow developers to:
- restore previous versions,
- track modifications,
- and manage collaboration.
Benefits of Version Control
| Benefit | Purpose |
|---|---|
| History Tracking | Records code changes |
| Collaboration | Supports teamwork |
| Backup | Protects source code |
| Recovery | Restores previous versions |
Importance of Version Control
Version control improves:
- software reliability,
- collaboration,
- and project maintenance.
KT0603 — Collaboration
Git supports collaboration between multiple developers working on the same project.
Developers can:
- share code,
- review changes,
- and merge updates.
Collaboration Activities
| Activity | Purpose |
|---|---|
| Sharing Code | Team development |
| Reviewing Changes | Quality control |
| Merging Code | Combine updates |
Importance of Collaboration
Collaboration supports:
- teamwork,
- efficient development,
- and project coordination.
KT0604 — Repositories
A repository is a storage location used to manage source code and project files.
Repositories contain:
- source code,
- project history,
- and version information.
Types of Repositories
| Repository Type | Description |
|---|---|
| Local Repository | Stored on local computer |
| Remote Repository | Stored online/server |
Examples of Remote Repositories
- GitHub
- GitLab
- Bitbucket
Importance of Repositories
Repositories help developers:
- organize projects,
- manage code,
- and collaborate online.
KT0605 — Branch
A branch is a separate version of a project used for development or experimentation.
Branches allow developers to:
- work independently,
- test features,
- and avoid affecting the main project.
Common Branch Types
| Branch | Purpose |
|---|---|
| main/master | Main project branch |
| feature branch | New feature development |
Importance of Branches
Branches improve:
- safe development,
- testing,
- and collaboration workflows.
KT0606 — Changes
Changes refer to modifications made to source code or project files.
Git tracks:
- added files,
- modified files,
- and deleted files.
Types of Changes
| Change Type | Description |
|---|---|
| Added | New file created |
| Modified | Existing file updated |
| Deleted | File removed |
Importance of Tracking Changes
Tracking changes helps developers:
- monitor progress,
- review updates,
- and manage project history.
KT0607 — Pull Requests
A pull request is a request to merge changes from one branch into another branch.
Pull requests allow team members to:
- review code,
- discuss changes,
- and approve updates.
Pull Request Workflow
| Step | Process |
|---|---|
| Create Branch | Develop feature |
| Commit Changes | Save updates |
| Create Pull Request | Request merge |
| Review | Check code |
| Merge | Combine changes |
Importance of Pull Requests
Pull requests improve:
- code quality,
- collaboration,
- and software reliability.
KT0608 — Source Code Control
Source code control refers to managing and tracking source code changes during software development.
Git provides source code control by:
- storing versions,
- tracking modifications,
- and supporting collaboration.
Benefits of Source Code Control
| Benefit | Purpose |
|---|---|
| Tracking | Records updates |
| Collaboration | Supports teamwork |
| Recovery | Restores previous versions |
| Security | Protects source code |
Importance of Source Code Control
Source code control improves:
- software maintenance,
- collaboration,
- and project stability.
KT0609 — Git Commands: git clone, git fetch, git checkout, git init, git commit, git push, git diff, git pull, git add, git branch
Git commands are used to manage repositories and source code workflows.
Common Git Commands
| Command | Purpose |
|---|---|
| git init | Creates a repository |
| git clone | Copies repository |
| git add | Adds changes |
| git commit | Saves changes |
| git push | Uploads changes |
| git pull | Downloads updates |
| git fetch | Retrieves updates |
| git checkout | Switches branches |
| git branch | Creates/views branches |
| git diff | Displays differences |
Example Commands
Initialize Repository
git init
Clone Repository
git clone repository-url
Add Files
git add .
Commit Changes
git commit -m "Initial commit"
Push Changes
git push
Importance of Git Commands
Git commands support:
- source code management,
- collaboration,
- and version control workflows.
3.5 Key Notes / Summary
- Git is a version control system.
- Version control tracks source code changes.
- Repositories store project files and history.
- Branches support independent development.
- Pull requests support code reviews and collaboration.
- Source code control improves project management.
- Git commands manage repositories and workflows.