DEV Community

The Accessible AI Hub
The Accessible AI Hub

Posted on

Git & GitHub Demystified: A Complete Beginner’s Guide with Real-World Use Cases

Ever written some code, made changes, and then thought, “Wait… it was working before, how do I go back?” If yes—you’re ready to learn Git and GitHub.


🌱 What is Git?

Git is like a time machine—but for your code. It’s an open-source, distributed version control system.

Let’s break that down:

  • Open-source: Free to use and modify (just like Python, Visual Studio Code, Linux, or Azure Machine Learning Studio).
  • Version control: Git tracks changes to your files so you can revisit older versions, compare edits, or even recover deleted code.
  • Distributed: Every developer has a full copy of the project’s history. That means you can work offline, make changes locally, and sync when you're ready.

📦 Real-World Example

Imagine you're working on a ASP.NET app in Visual Studio for your company’s internal dashboard. You add a new feature, but later realize it breaks existing functionality. With Git, you can:

  • View what changed
  • Switch back to the earlier version
  • Try another approach — all without fear of losing anything

This same system is used by developers working on Azure AI Foundry, Visual Studio, Microsoft 365, or even open-source C++ libraries on GitHub.


📍 Where is Git used?

Git is used everywhere—from solo hobby projects to large-scale enterprise codebases. Whether you’re:


❓ Why Git?

Here’s why Git is powerful:

  • 🧠 Keeps a memory of every change
  • 🧑‍🤝‍🧑 Facilitates collaboration: Multiple people can work on the same project
  • 🧪 Risk-free experimentation: Try new ideas in isolation with branches
  • 🕵️‍♂️ Track issues fast: Use history logs to find when and why a bug was introduced

Analogy: Think of Git as Google Docs for code, but way more powerful. You can:

  • Work offline
  • Rewind anytime
  • See who wrote what
  • Restore lost versions

🔧 Git Setup and Installation

Getting started is easy:

  1. Visit https://git-scm.com/downloads
  2. Download the version for your OS (Windows, macOS, Linux)
  3. Install Git

If you're using Visual Studio Code, it comes with Git integration built in. Combine it with GitHub Copilot, and you’ll write and track smart code effortlessly!


🛠️ Core Git Concepts (With Real Examples)

📁 Working Tree

This is the folder where you actually work. Let’s say you're writing a C++ module for an edge device using Azure IoT Edge—your .cpp and .h files live here.

➕ Staging

You pick which changes to “stage” for saving. Think of this as your shopping cart—you can still remove or add things before you “checkout.”

✅ Commit

Now you're saving your staged changes to the local Git history. It’s like taking a snapshot of your project at that moment.

💻 Local Repository

This is your personal timeline. Changes live here until you're ready to sync them with others (using GitHub).


✨ Must-Know Git Commands

Command What It Does
git init Initializes a Git repo
git status Shows what’s changed
git add . Stages all changes
git commit -m "message" Saves changes with a message
git log Shows commit history
git reset --hard <SHA> Reverts to a specific state

💡 Microsoft Developer Tip: Use these inside VS Code, Visual Studio, or Git Bash. You can also track your Azure DevOps Pipelines or .NET MAUI project code the same way.


🧠 Git vs GitHub

Git GitHub
Local version control Cloud-based hosting service
Manages versions Hosts repositories
CLI tool Web UI with additional tools
Works offline Needs internet to sync

Imagine Git is your personal notebook, and GitHub is the shared digital library where everyone can read and contribute.


🌍 What is GitHub?

GitHub is a platform where:

  • You can store, collaborate, and publish your code
  • People can contribute to your project via Pull Requests
  • Teams manage entire software projects across the globe

🎯 It’s where Microsoft hosts open-source SDKs for Azure AI, ML.NET, Power Platform Connectors, and more.


🔑 Common GitHub Terms (With Use Cases)

🌱 Branch

A sandbox to try new things.

Let’s say you’re building a C# WPF app and want to add Azure login. Create a new branch → add code → test → then merge if successful.

📣 Pull Request (PR)

Want your changes to be included in the main project? Raise a PR for someone to review it.

Example: You’re working with your team on a web app using Azure Static Web Apps. You improve the UI—raise a PR so your team lead can review and merge it.

🍴 Fork

Copy someone’s repository to your account.

You can:

  • Add new features
  • Fix bugs
  • Learn from others’ code All without breaking the original.

💼 Real-Life Developer Workflow (Example)

Let’s say you’re a junior developer at a healthcare startup using Azure AI Foundry to build diagnostic models.

  1. Clone the repo using git clone
  2. Create a feature branch using git checkout -b feature-azure-login
  3. Make changes locally using Python and commit them
  4. Push the branch to GitHub: git push origin feature-azure-login
  5. Create a Pull Request
  6. Team reviews it → If approved → Merged to main branch
  7. Your code goes live with DevOps CI/CD pipelines

💡 Developer Tools That Work Seamlessly with Git & GitHub

Tool Integration
Visual Studio Built-in Git and GitHub panel
VS Code GitHub + GitHub Copilot + Azure DevOps
Azure DevOps Git repos + Pipelines + Boards
Azure ML Studio Track model versioning using Git
Azure AI Foundry Source-controlled prompt flows and agents
.NET GitHub Actions for deployment
Python Track notebooks, use DVC or MLflow
Java Use GitHub for managing Spring Boot APIs
C++ Contribute to open-source libraries securely
Responsible AI Audit logs, model cards, Git-integrated governance

🔐 Developer Security with GitHub

Security isn’t optional. GitHub offers:

⚠️ Example: If you accidentally commit an API key while testing a Flask app, GitHub can automatically detect and alert you. Plus, you can integrate GitHub with Microsoft Sentinel for security telemetry.


🤝 Collaboration for Everyone

Whether you’re:

Git and GitHub are essential for collaboration, transparency, rollback, and confidence.


🚀 Final Thoughts

Learning Git and GitHub might seem overwhelming at first, but with consistent practice, they become second nature. They’re not just tools—they’re superpowers that every developer must wield.

🎯 You’ll write more confidently, break less code, and contribute to real-world projects—open-source, startup, enterprise, or research—while aligning with Microsoft’s developer ecosystem.


📚 Want to Go Further?


Blog by:
Deepthi Balasubramanian
Microsoft Student Ambassador - Gold

© 2025 The Accessible AI Hub. All rights reserved.

Top comments (0)