How to Use GitHub Complete Beginner Guide (2026)

 

How to Use GitHub Complete Beginner Guide (2026)

GitHub is the most important tool every programmer must know.

Every developer, every company, every open source project uses GitHub. Without GitHub knowledge you are missing a critical skill that every employer expects.

This complete guide covers everything you need to know about GitHub from scratch.

Let's get started.


1. What is GitHub?

GitHub is a platform for storing, sharing and collaborating on code.

Think of GitHub as:

  • Google Drive but for code
  • Social media but for developers
  • A portfolio platform for programmers

Key terms:

TermMeaning
Git   Version control system — tracks code changes
GitHub   Online platform that hosts Git repositories
Repository   Folder containing your project and its history
Commit   Saving a snapshot of your code
Branch   Separate version of your code
Merge   Combining branches together
Clone   Downloading a repository to your computer
Fork   Creating your own copy of someone else's repo
Pull Request   Requesting to merge your changes

2. Why Every Programmer Needs GitHub

ReasonDetails
Portfolio   Show your work to employers
Backup   Never lose your code again
Collaboration   Work with other developers
Version control  Track every change you make
Open source  Contribute to real projects
Job hunting  Employers check GitHub profiles
Learning  Study other developers code

3. Install Git

GitHub requires Git installed on your computer.

Windows

  1. Go to git-scm.com
  2. Download Git for Windows
  3. Install with default settings
  4. Open Command Prompt and verify:
git --version

Mac

# Using Homebrew
brew install git

# Verify
git --version

Linux (Ubuntu)

sudo apt update
sudo apt install git

# Verify
git --version

4. Configure Git

After installing set up your identity:

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

# Verify configuration
git config --list

5. Create Your GitHub Account

Steps:

  1. Go to github.com
  2. Click Sign Up
  3. Enter username, email and password
  4. Choose free plan
  5. Verify your email
  6. Complete profile setup

Profile Tips:

  • Use professional username
  • Add profile picture
  • Write a short bio
  • Add your location
  • Pin your best repositories

6. Create Your First Repository

On GitHub Website:

  1. Click + icon top right
  2. Click New Repository
  3. Enter repository name
  4. Add description
  5. Choose Public or Private
  6. Check Add README file
  7. Click Create Repository

7. Core Git Commands

These are the commands you will use every single day:

Initialize a new repository

git init

Check status of files

git status

Add files to staging area

# Add specific file
git add filename.py

# Add all files
git add .

Commit changes

git commit -m "Your commit message here"

View commit history

git log

# Compact view
git log --oneline

Connect to GitHub repository

git remote add origin https://github.com/username/repository.git

Push code to GitHub

git push origin main

Pull latest changes

git pull origin main

Clone a repository

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

8. Complete Git Workflow

This is the workflow you will follow every time you code:

# Step 1 - Check what changed
git status

# Step 2 - Add your changes
git add .

# Step 3 - Commit with message
git commit -m "Added Python functions module"

# Step 4 - Push to GitHub
git push origin main

Do this every time you finish a coding session. ✅


9. Working with Branches

Branches let you work on new features without affecting main code.

Create a new branch

git branch feature-login

Switch to branch

git checkout feature-login

# Create and switch in one command
git checkout -b feature-login

List all branches

git branch

Merge branch into main

# Switch to main first
git checkout main

# Merge feature branch
git merge feature-login

Delete branch after merging

git branch -d feature-login

10. The README File

Every good GitHub repository needs a README.md file.

What to include in README:

SectionContent        
Project title   Name of your project
Description   What the project does
Installation   How to install and run
Usage   How to use the project
Screenshots   Show the project in action
Technologies   What you used to build it
License   How others can use your code

Example README structure:

# Project Name

A brief description of what this project does.

## Installation

pip install -r requirements.txt

## Usage

python main.py

## Technologies Used

- Python 3.11
- Flask
- SQLite

## License

MIT License

11. Forking and Contributing

Fork a Repository

  1. Find a repository you want to contribute to
  2. Click Fork button top right
  3. This creates your own copy

Make Changes and Create Pull Request

  1. Clone your forked repository
  2. Create a new branch
  3. Make your changes
  4. Push to your fork
  5. Click New Pull Request
  6. Describe your changes
  7. Submit for review

12. GitHub for Python Projects

Typical Python Project Structure on GitHub

my-python-project/

│
├── README.md
├── requirements.txt
├── .gitignore
├── main.py
├── src/
│   ├── __init__.py
│ ├── module1.py │ └── module2.py ├── tests/ │ └── test_main.py └── docs/ └── documentation.md

The .gitignore File

Tell Git which files to ignore:

# Python .gitignore
__pycache__/
*.py[cod]
*.so
.env
venv/
.venv/
*.egg-info/
dist/
build/
.pytest_cache/
.DS_Store

requirements.txt

List all project dependencies:

# Generate requirements.txt
pip freeze > requirements.txt

# Install from requirements.txt
pip install -r requirements.txt

13. GitHub Pages

Host your website for free using GitHub Pages.

Steps:

  1. Create repository named username.github.io
  2. Add your HTML CSS JS files
  3. Go to Settings → Pages
  4. Select main branch as source
  5. Your site is live at username.github.io

14. Useful GitHub Features

FeatureWhat It Does
Issues    Track bugs and feature requests
Projects    Kanban board for managing tasks
Actions    Automate workflows and CI/CD
Wiki    Documentation for your project
Releases    Version your software releases
Gists    Share small code snippets
Stars    Bookmark interesting repositories
Watch    Get notifications for repositories

15. GitHub for Job Hunting

Employers check your GitHub profile. Make it count.

Profile Checklist

ItemStatus
Professional username✅
Profile picture✅
Bio with skills✅
Pinned repositories✅
Green contribution graph✅
README on profile✅
At least 5 projects✅

Create a Profile README

  1. Create repository with same name as your username
  2. Add README.md to it
  3. This README appears on your profile

Example profile README:

# Hi I am Rahul 👋

Python Developer | AI Enthusiast | Open Source Contributor

## Skills
- Python | Django | Flask
- Machine Learning | TensorFlow
- Data Science | Pandas | NumPy

## Projects
- CodeMindset Blog — Python tutorials and AI guides
- Price Tracker — Python web scraping tool
- Sentiment Analyzer — NLP project

## Connect
- Pinterest: CodeMindset
- Blog: codemindset1.blogspot.com

16. Common Git Mistakes and Fixes

MistakeFix
Wrong commit message  git commit --amend -m "new message"
Accidentally added wrong file  git reset HEAD filename
Need to undo last commit  git reset --soft HEAD~1
Accidentally deleted file   git checkout -- filename
Wrong branch  git checkout correct-branch
Merge conflict  Edit conflicted files manually then commit

17. Git Commands Quick Reference

CommandPurpose
git init  Initialize repository
git clone URL  Clone repository
git status  Check file status
git add .  Stage all changes
git commit -m ""  Commit changes
git push origin main  Push to GitHub
git pull origin main  Pull from GitHub
git branch  List branches
git checkout -b name  Create and switch branch
git merge branch  Merge branch
git log --oneline  View commit history
git diff  See unstaged changes
git stash  Temporarily save changes

Final Words

GitHub is not optional for programmers in 2026. It is essential.

Every project you build should be on GitHub.

Start today:

  1. Create GitHub account
  2. Install Git on your computer
  3. Push your existing Python projects to GitHub
  4. Commit code every single day
  5. Build a green contribution graph

The green squares on your GitHub contribution graph are proof of your consistency to every employer who checks your profile.

Keep learning. Keep building. 🚀


Follow CodeMindset on Pinterest for coding guides, Python tutorials and developer tips.

Comments

Popular posts from this blog

Best Laptops for Programming Students in India 2026

Best Study System for Students in 2026 (Study Smarter Not Harder)