Introduction to Version Control
Version control refers to systems and processes that track changes to files, folders, and projects over time.
What Should Be Version Controlled?
Version control is useful for anything that:
- Changes over time
- Needs to be shared with others
- Requires collaboration and traceability
What Can Version Control Do?
Capability | Description |
---|---|
Track files | Monitor files in different states |
Combine versions | Merge content from different contributors |
Identify versions | Tag and refer to specific commits |
Revert | Restore older versions of files or directories |
Why Is Version Control Important?
- Ensures nothing is lost
- Allows collaboration across teams
- Provides accountability
- Enables rollback in case of bugs or unwanted changes
Introducing Git
Git is a version control system widely used in software development and data projects.
- Open source
- Scalable and fast
- Tracks every version
- Supports collaboration through platforms like GitHub or GitLab
Benefits of Git
Benefit | Explanation |
---|---|
🔁 Recoverable | Nothing is lost, every version is saved |
👥 Collaborative | Track who changed what and when |
⏪ Revertible | Undo changes with a single command |
🔍 Comparable | View differences across versions |
Using Git
Git works via the terminal (shell):
- It’s a program for executing commands
- Lets you inspect and navigate files
Useful Terminal Commands
pwd # Print current directory
ls # List contents of the folder
cd folder # Change directory
Check Git Version
git --version
Expected Output:
git version 2.46.0