Version Control Systems (VCS) Cheatsheet

📌 What is Version Control?

Version Control is a system that records changes to files over time so that you can recall specific versions later.

It helps in:

  • Tracking file changes
  • Collaborating with teams
  • Rolling back to previous versions
  • Branching and merging code for new features or fixes

🧠 Types of Version Control

TypeDescriptionExamples
Local VCSTracks changes on a local machineRCS (Revision Control System)
Centralized VCS (CVCS)One central server; all clients pull/push from itCVS, Subversion (SVN), Perforce
Distributed VCS (DVCS)Every client has a complete repo with full historyGit, Mercurial

🔧 Popular Version Control Systems

VCSDescription
GitMost widely used, distributed, supports local commits and branching
SVNCentralized, still used in some enterprise systems
MercurialDVCS similar to Git, simpler interface
PerforceEnterprise-level CVCS, high performance
TFS / Azure DevOpsVersion control + project tracking (by Microsoft)

🧰 Git Basics (Most Popular VCS)

CommandDescription
git initInitialize a Git repository
git clone [url]Clone a remote repository
git statusShow current state of the repo
git add [file]Stage changes
git commit -m "message"Commit staged changes
git pushPush commits to remote repo
git pullFetch + merge changes from remote
git branchList branches
git checkout [branch]Switch to another branch
git merge [branch]Merge another branch into current
git logView commit history

🌿 Git Branching Model

BranchPurpose
main or masterProduction-ready code
developIntegration branch for features
feature/*New features in development
release/*Pre-release testing/stabilization
hotfix/*Urgent fixes for production bugs

📦 Git Hosting Services

PlatformFeatures
GitHubOpen source, collaboration, Actions (CI/CD)
GitLabDevOps pipeline built-in
BitbucketIntegrates with Jira, supports Git & Mercurial
Azure ReposMicrosoft’s cloud-based Git/SVN hosting

🛠️ Best Practices

  • Commit often with meaningful messages
  • Use branches for features and fixes
  • Pull and review before pushing
  • Avoid committing secrets/passwords
  • Use .gitignore to exclude unnecessary files
  • Merge with pull requests and code reviews

📚 Tools & GUIs

ToolDescription
GitKraken, SourcetreeGit desktop clients
VS Code Git panelBuilt-in Git UI
Git CLICore Git commands
GitHub DesktopEasy GitHub integration

📘 Learn More

Share with