Introduction

If you’re a developer, knowing Git and GitHub isn’t optional anymore — it’s essential. Whether you’re applying for jobs, contributing to open-source, or managing your own projects, GitHub is the platform that ties everything together.

This Full GitHub Course covers everything from basic version control to advanced collaboration workflows. By the end, you’ll be comfortable using Git on the command line, managing branches, resolving merge conflicts, contributing to open-source, and even setting up CI/CD pipelines.

Let’s dive in.

📌 Quick Stats:

  • GitHub has over 100 million developers worldwide
  • 90%+ of organizations use Git for version control
  • Learning GitHub can increase your hiring chances by 40%

Chapter 1: What is Git & GitHub?

What is Git?

Git is a distributed version control system created by Linus Torvalds in 2005. It tracks changes in your code, lets you revert to previous versions, and allows multiple people to work on the same project without stepping on each other’s toes.

What is GitHub?

GitHub is a cloud-based hosting service for Git repositories. It adds a web interface, collaboration tools, pull requests, issues, project boards, and much more on top of Git.

Feature Git GitHub
Type CLI Tool Web Platform
Works Offline ✅ Yes ❌ No
Pull Requests ❌ No ✅ Yes
Issue Tracking ❌ No ✅ Yes
CI/CD ❌ No ✅ GitHub Actions

Chapter 2: Installing Git

Linux (Ubuntu/Debian)

sudo apt update
sudo apt install git -y
git --version

macOS

brew install git
# Or download from git-scm.com

Windows

Download from git-scm.com and run the installer. Make sure to check “Git Bash” during installation.

Configure Git

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

Chapter 3: Git Basics — Your First Repository

Initialize a Repository

mkdir my-project
cd my-project
git init

The Staging Area

Git has three main areas: Working DirectoryStaging AreaRepository

# Check status
git status

# Add file to staging
git add index.html
# Add all files
git add .

# Commit changes
git commit -m "Initial commit: add index.html"
💡 Pro Tip: Write meaningful commit messages. “Fixed bug” is useless six months later. “Fix login redirect after OAuth timeout” is gold.

Chapter 4: Branching & Merging

Branches let you work on features independently without breaking the main codebase.

Working with Branches

# List branches
git branch

# Create a new branch
git branch feature-navbar

# Switch to it
git checkout feature-navbar
# Or in one step:
git checkout -b feature-navbar

Merging

# Switch to main branch first
git checkout main

# Merge your feature branch
git merge feature-navbar

Merge Conflicts

When two branches modify the same file, Git can’t automatically merge. You’ll see something like:

<<<<<<< HEAD
console.log("Hello from main");
=======
console.log("Hello from feature");
>>>>>>> feature-navbar

Edit the file to keep what you want, remove the markers, then:

git add resolved-file.js
git commit -m "Resolve merge conflict in resolved-file.js"

Chapter 5: GitHub — Pushing Your Code Online

Create a Repository on GitHub

  1. Go to github.com/new
  2. Give it a name (e.g. my-project)
  3. Choose Public or Private
  4. Don’t initialize with a README (you already have a local repo)

Connect & Push

git remote add origin https://github.com/your-username/my-project.git
git branch -M main
git push -u origin main

Clone an Existing Repository

git clone https://github.com/username/repository.git
cd repository

Chapter 6: Collaboration Workflows

Pull Requests (PRs)

Pull requests are the heart of open-source collaboration. Here’s the workflow:

  1. Fork a repository on GitHub
  2. Clone your fork locally
  3. Create a branch for your change
  4. Commit your changes
  5. Push to your fork
  6. Open a Pull Request on GitHub
  7. Discuss & iterate with reviewers
  8. Merge when approved

Keeping Your Fork Updated

git remote add upstream https://github.com/original-owner/repo.git
git fetch upstream
git checkout main
git merge upstream/main
git push origin main

Code Reviews

On GitHub, you can review PRs line-by-line, leave comments, and request changes. Good code reviews:

  • Focus on logic, not style (use linters for style)
  • Ask questions instead of making demands
  • Point out what’s good, not just what’s wrong
  • Use GitHub’s suggestion feature for minor fixes

Chapter 7: GitHub Actions — CI/CD Made Simple

GitHub Actions automates your workflow — running tests, deploying code, or sending notifications when events happen in your repo.

Your First Workflow

Create .github/workflows/test.yml in your repo:

name: Run Tests
on: [push, pull_request]
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 20
      - run: npm ci
      - run: npm test

Now every time you push, GitHub runs your tests automatically. Green checkmark = good. Red X = fix it.

Chapter 8: Advanced Git Techniques

Interactive Rebase

Clean up messy commit history before merging:

git rebase -i HEAD~3

This opens an editor where you can squash, reword, or reorder commits.

Git Stash

Save uncommitted work temporarily:

git stash
git stash pop  # Restore it
git stash list # See all stashes

Cherry Pick

Apply a specific commit from one branch to another:

git cherry-pick abc1234

Git Bisect

Find which commit introduced a bug using binary search:

git bisect start
git bisect bad  # Current commit is broken
git bisect good abc1234  # This commit was good
# Git checks out a midpoint — test and tell Git:
# git bisect good  OR  git bisect bad
# Repeat until the bad commit is found
git bisect reset

Chapter 9: GitHub Profile & Portfolio

Your GitHub profile is your developer resume. Here’s how to make it stand out:

1. Create a Profile README

Create a repo named your-username/your-username (exactly matching your username). Add a README.md that introduces yourself.

2. Pin Your Best Repos

GitHub lets you pin up to 6 repositories on your profile. Choose the ones that showcase your best work.

3. Contribute to Open Source

Even small contributions matter — fixing a typo in documentation is a legit first PR. Use good first issue labels to find beginner-friendly tasks.

4. Green Squares Matter

Consistent commit activity shows you’re actively coding. It doesn’t have to be every day, but regular contributions build trust with employers.

Chapter 10: Common Git Mistakes & How to Fix Them

❌ Mistake: Committed to the wrong branch
✅ Fix:

git log --oneline -5  # Find your commit hash
git checkout correct-branch
git cherry-pick abc1234
git checkout wrong-branch
git reset HEAD~1 --hard  # Remove from wrong branch
❌ Mistake: Accidentally committed sensitive data (passwords, API keys)
✅ Fix:

# Remove from history
git filter-branch --force --index-filter \
  "git rm --cached --ignore-unmatch .env" \
  --prune-empty --tag-name-filter cat -- --all
# Then force push (be very careful!)
git push origin --force --all

Conclusion

Git and GitHub are not just tools — they’re the foundation of modern software development. Mastering them opens doors to better jobs, open-source contributions, and more organized personal projects.

Here’s your action plan:

  1. ✅ Install Git today
  2. ✅ Create a GitHub account (if you don’t have one)
  3. ✅ Push your first project
  4. ✅ Make a pull request to an open-source project this week
  5. ✅ Set up GitHub Actions on one repo
  6. ✅ Polish your GitHub profile

GitHub is free, and the best time to start was yesterday. The second best time is now.

Published by TricksPage.com — Your source for the latest tech tutorials and guides.

More Free Courses on TricksPage

  • Git & GitHub Course — Master Git from basics to collaboration workflows, CI/CD, and open-source.
  • Linux Commands Course — Complete Linux command line mastery — navigation, text processing, scripting, networking.
  • Docker & Swarm Course — Containers, Dockerfiles, Compose, Swarm orchestration, and production deployment.
  • n8n Automation Course — Workflow automation with 400+ integrations, webhooks, AI, and error handling.
  • Agentic AI Course — Build AI agents with ReAct patterns, tools, memory, and multi-agent orchestration.

Leave a Reply

Your email address will not be published. Required fields are marked *