Skip to content

What is Git and GitHub? How Do They Work?

Git is an open-source, distributed version control system (VCS) that tracks changes in your code locally on your computer.

GitHub is a web-based cloud platform that hosts Git repositories online and enables collaboration with other developers.

Think of it this way:

  • Git = The tool (like Microsoft Word)
  • GitHub = The cloud storage (like Google Drive for your code)

Git works locally on your machine, while GitHub stores your code in the cloud and adds collaboration features.

Terminal window
git init # Initialize a new repository
git add . # Stage your changes
git commit -m "message" # Save a snapshot
git status # Check current state
git log # View commit history
Terminal window
git clone <url> # Download a repository from GitHub
git remote add origin <url> # Connect local repo to GitHub
git push origin main # Upload your changes to GitHub
git pull origin main # Download latest changes from GitHub

The workflow:

  1. Make changes locally → git addgit commit
  2. Push to GitHub → git push
  3. Collaborate → others can git pull your changes

No, it’s easier than you think.

You only need 5-10 commands for daily work:

  • git clone, git add, git commit, git push, git pull
  • git status, git log, git branch
  • Start with the basics—don’t try to learn everything at once
  • Practice by creating a small project and tracking changes
  • Use visual tools like GitHub Desktop or GitKraken if the command line feels intimidating

📚 Pro Git Book (free online)

  • Clear explanations of how Git works
  • Covers essential commands with examples
  • Available in multiple languages

Timeline: You can be comfortable with Git basics in 1-2 weeks of practice.


  • Required skill: Almost every development job expects Git knowledge
  • Portfolio: GitHub serves as your professional portfolio
  • Collaboration: Industry-standard tool for team projects
  • Safety net: Never lose your work—you can always revert changes

Bottom line: Git seems scary at first, but it’s one of the most valuable tools you’ll learn. Start simple, practice regularly, and you’ll wonder how you ever coded without it.


Want to try Git right now? Here’s a simple 5-minute exercise:

Terminal window
# 1. Create a folder and initialize Git
mkdir my-first-repo
cd my-first-repo
git init
# 2. Create a file
echo "# My First Project" > README.md
# 3. Track and save your changes
git add README.md
git commit -m "Initial commit"
# 4. Check your history
git log

Congratulations! You just created your first Git repository. 🎉