Welcome to GitHub Tutorials

Learn Git and GitHub from basics to advanced with step-by-step tutorials, real-world examples, and best practices for developers.

Start Learning for Free

GitHub Beginner Guide (Step by Step)

This page explains GitHub from zero using simple steps and commands.

Step 1: Create GitHub Account

GitHub is an online platform used by developers to store, manage, and collaborate on source code using Git.

To start using GitHub:

  • Go to https://github.com
  • Click Sign Up
  • Enter Email, Username, Password
  • Verify your email
  • Complete the required verification steps
  • Log in to your GitHub account.

Once your account is created, you can:

  • Create repositories to store your projects.
  • Create and manage branches.
  • Push your local code to GitHub.
  • Pull the latest code from GitHub.
  • Create Pull Requests (PRs) for code review.
  • Collaborate with other developers.

Step 2: Install Git

What is Git? Git is a distributed version control system (VCS) used to track changes in source code and manage different versions of a project.

  • Download Git from https://git-scm.com
  • Install using default settings
  • Open Git Bash
git --version

Step 3: Configure Git

What is Git Configuration?
Git configuration means setting up your name and email address in Git so that Git can identify who made each commit. Whenever you create a commit, Git stores information about the person who made that change.

For example:

Author: Mazhar
Email: mazhar@example.com
Commit: Added login functionality

This is especially important when working in a team because developers can easily identify who made which changes.

Set your name and email (used in commits)

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

Step 4: Generate SSH Key

SSH key is used to connect GitHub securely

What is an SSH Key?
SSH (Secure Shell) key is a secure authentication method used to establish a connection between your local computer and GitHub without entering your GitHub password every time.
In Git, SSH authentication uses a pair of keys:
Private Key → Stored securely on your computer. Never share this with anyone.
Public Key → Added to your GitHub account. It can be shared with GitHub.

ssh-keygen -t ed25519 -C "youremail@gmail.com"
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519
clip < ~/.ssh/id_ed25519.pub

Step 5: Add SSH Key to GitHub

After generating the SSH key, the next step is to add your public SSH key to your GitHub account.

Why do we add the SSH key to GitHub?
GitHub needs to know that your computer is authorized to access your repositories.
You add the public key to GitHub, while the private key remains safely on your computer.

  • GitHub → Settings
  • SSH and GPG Keys
  • Click New SSH Key
  • Paste copied key like(ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAI.... your-email@example.com) and save
ssh -T git@github.com

Step 6: Create Repository

  • Click + → New Repository
  • Repository name: my-first-repo
  • Select Public/Private
  • Click Create

Step 7: Create Local Project

mkdir my-first-repo
cd my-first-repo
git init

Step 8: Create File

touch README.md
echo "# My First GitHub Project" > README.md

Step 9: Push Code to GitHub

git add .
git commit -m "Initial commit"
git remote add origin git@github.com:USERNAME/my-first-repo.git
git branch -M main
git push -u origin main

Step 10: Daily Git Commands

git status
git pull
git push

Basic Git Flow

Edit → Add → Commit → Push


Section 1: Upload Project Using CMD (Command Line)

Step 1: Open CMD in Project Folder

Go to your project folder, right-click, and select Open in Terminal / CMD.

Step 2: Initialize Git

git init

Step 3: Add Files

git add .

Step 4: Commit Files

git commit -m "Initial commit"

Step 5: Add GitHub Repository URL

git remote add origin https://github.com/USERNAME/REPOSITORY-NAME.git

Step 6: Push Project to GitHub

git branch -M main
git push -u origin main

Your project is now uploaded to GitHub.


Section 2: Upload Project Using GitHub Repository (Website)

Step 1: Create a Repository

  1. Go to github.com
  2. Click +New repository
  3. Enter repository name
  4. Click Create repository

Step 2: Upload Files

  1. Open the repository
  2. Click Add fileUpload files
  3. Select your project files

Step 3: Commit Changes

  1. Add a commit message
  2. Click Commit changes

Your project is uploaded without using CMD.


How to Add People to a Private GitHub Repository

Step 1: Open Repository Settings

Go to your private repository and click on the Settings tab.

Step 2: Open Collaborators

From the left menu, select Collaborators.

Step 3: Add a Person

  1. Click Add people
  2. Enter GitHub username or email
  3. Click Add

Step 4: Invitation Acceptance

The invited user must accept the GitHub invitation to gain access.

Permissions