Skip to main content

Introduction to Git & GitHub

Welcome to the Git & GitHub Tutorial Series by CodeHarborHub β€” your ultimate guide to mastering version control and collaboration. Whether you’re a beginner or a developer looking to refine your workflow, this guide will help you understand how Git and GitHub work and how to use them efficiently.

What is Version Control?​

Version Control is a system that tracks changes to your project’s files over time.

It allows developers to:

  • Save different versions of a project.
  • Revert to previous states if needed.
  • Collaborate with multiple people without conflicts.
  • Keep track of who made what changes and when.

Imagine working on a big project with your team. Instead of sending updated files manually, Git handles all version tracking automatically β€” making teamwork seamless.

What is Git?​

Git is a distributed version control system (DVCS) created by Linus Torvalds (the creator of Linux) in 2005. It helps you track, manage, and synchronize code changes locally and remotely.

Key Features of Git​

  • Version Tracking: Keeps a full history of your project.
  • Branching & Merging: Safely experiment without affecting main code.
  • Offline Work: All operations can be done locally.
  • Distributed System: Every developer has a full copy of the repository.

What is GitHub?​

GitHub is a web-based platform that hosts your Git repositories online. It adds collaboration features like issues, pull requests, project boards, actions, and discussions β€” making it the world’s largest community for developers and open-source projects.

In Short
  • Git = Tool for version control
  • GitHub = Platform to host and collaborate on Git repositories

Installing Git​

Before using Git, install it on your system.

Windows​

  1. Visit git-scm.com/downloads
  2. Download the Windows installer.
  3. Follow the setup wizard (keep default settings).

macOS​

brew install git

Linux (Ubuntu/Debian)​

sudo apt install git

Once installed, verify:

git --version

First-Time Setup​

Before committing code, configure your Git identity:

git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"

To check your setup:

git config --list

You’re now ready to start using Git!


Git Workflow Overview​

Git follows a 3-stage workflow:

StageDescription
Working DirectoryWhere you make changes to files.
Staging AreaWhere you prepare changes before saving them.
RepositoryWhere committed versions are stored permanently.

Basic Flow:​

git add β†’ git commit β†’ git push

Git vs GitHub vs GitLab vs Bitbucket​

ToolTypeDescription
GitVersion Control ToolTracks code changes locally.
GitHubHosting PlatformCloud service for Git repositories.
GitLabHosting + DevOpsOffers CI/CD pipelines & issue tracking.
BitbucketHosting PlatformGit-based collaboration by Atlassian.

Why Developers Use Git & GitHub​

  • Manage project versions effortlessly
  • Collaborate with teams globally
  • Securely backup and share code
  • Learn from open-source projects
  • Automate workflows with GitHub Actions
  • Showcase your work with GitHub profile and portfolio

Coming Next​

Now that you know the basics, move on to the next part: πŸ‘‰ Git Basics β€” Create, Commit & Track Changes

Additional Resources​

Summary​

ConceptDescription
GitTool for tracking code changes.
GitHubPlatform for hosting and collaboration.
Version ControlTracks project evolution and team changes.
Setup CommandsConfigure Git username and email.
Next StepLearn Git Basics and start committing your code!

πŸ’™ This tutorial is part of the CodeHarborHub Git & GitHub learning path β€” empowering developers to build, collaborate, and grow together.