0
0
Gitdevops~30 mins

Distributed vs centralized version control in Git - Hands-On Comparison

Choose your learning style9 modes available
Understanding Distributed vs Centralized Version Control with Git
📖 Scenario: You are working on a small team project. You want to understand how version control systems work, especially the difference between centralized and distributed systems. You will practice basic Git commands to see how distributed version control works in real life.
🎯 Goal: Learn how to create a local Git repository (distributed version control), connect it to a remote repository (centralized server), and understand the difference by practicing basic Git commands.
📋 What You'll Learn
Create a local Git repository
Add a file and commit changes locally
Add a remote repository URL
Push local commits to the remote repository
Understand the difference between local and remote repositories
💡 Why This Matters
🌍 Real World
Version control is essential for software development teams to track changes, collaborate, and avoid conflicts.
💼 Career
Understanding Git and the difference between distributed and centralized version control is a key skill for developers, DevOps engineers, and IT professionals.
Progress0 / 4 steps
1
Create a local Git repository
Run the command git init in your project folder to create a local Git repository.
Git
Need a hint?

Use git init to start version control locally.

2
Add a file and commit changes locally
Create a file named README.md with some text, then run git add README.md and git commit -m "Initial commit" to save changes locally.
Git
Need a hint?

Create the file with echo or a text editor, then add and commit it.

3
Add a remote repository URL
Run git remote add origin https://example.com/user/repo.git to link your local repository to a remote centralized repository.
Git
Need a hint?

Use git remote add origin followed by the remote URL.

4
Push local commits to the remote repository
Run git push -u origin main to send your local commits to the remote repository and set the upstream branch.
Git
Need a hint?

Use git push -u origin main to upload commits and track the remote branch.