Structured Programming Lab Lecture 1
Structured Programming Lab Lecture 1
1
• Provides Documentation of Changes: Every commit in a ver-
sion control system is accompanied by a message describing what was
changed, creating a valuable reference for team members.
• Advantages:
• Disadvantages:
– If the central server crashes, the entire project history may be lost.
– Requires a constant network connection to interact with the repos-
itory.
2
1.2.3 Distributed Version Control (DVCS)
• Each developer has a full copy of the entire repository, including all
versions and history.
• Advantages:
– Developers can work offline, committing changes locally before
syncing with a remote repository.
– Better redundancy: No single point of failure, as every copy of the
repository contains a complete project history.
• Examples: Git, Mercurial, Bazaar.
• Why Git is Popular? Git provides speed, flexibility, and powerful
branching/merging capabilities, making it the industry standard.
3
2.2 What is GitHub?
GitHub is a cloud-based Git repository hosting service that provides
version control, collaboration, and automation for software projects.
• Code History and Versioning: Helps track changes, revert versions, and
debug efficiently.
4
3.3 Adding and Committing Files
g i t add f i l e n a m e . c
g i t commit −m ” I n i t i a l commit”
Instructions:
# I n i t i a l i z e a Git r e p o s i t o r y
mkdir g i t l a b
cd g i t l a b
git init
# Push t he p r o j e c t t o GitHub
5
g i t remote add o r i g i n h t t p s : / / g i t h u b . com/ username / g i t l a b . g i t
g i t push −u o r i g i n main
5 Summary
• Version Control tracks changes, enables collaboration, and ensures code
security.