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