Skip to content
Free course Programming Certificate included

Git & GitHub for Beginners

Track your code, work with others and publish your projects

  • Beginner level
  • 7 hours
  • 13 lessons
  • English
  • By Muninder Singh

What you'll learn

  • Explain version control and the difference between Git and GitHub
  • Install and configure Git on Windows, macOS or Linux
  • Create a repository and record changes with add and commit
  • Read history with log and diff, and undo mistakes safely
  • Create branches, merge them and resolve merge conflicts
  • Connect to GitHub and use clone, push and pull
  • Collaborate with pull requests and write a good README
  • Keep passwords and secrets out of Git and publish a site with GitHub Pages

Course curriculum

4 sections · 13 lessons · 7h 30m

01Getting Started with Git 3 lessons
  • What Are Git and GitHub? Free preview25 min

    The problem Git solves

    You have probably seen folders like this:

    project_final.html
    project_final2.html
    project_final_REAL.html
    project_final_REAL_use_this.html

    Nobody remembers what changed between these copies, which one is newest, or how to combine a friend's edits with yours. If your laptop crashes, all of them may be lost.

    Git solves this. It is a free, open-source version control system that records snapshots of your project over time. This Git and GitHub for beginners course teaches you to use it from the very first command, and to share your work online with GitHub.

    What version control gives you

    • History: every saved change, with who made it, when and why.
    • Undo: go back to any earlier version of a file or the whole project.
    • Safe experiments: try a new idea on a separate branch without touching the working version.
    • Teamwork: several people can edit the same project and combine their work.
    • Backup: a copy of the project on GitHub survives a lost or broken laptop.

    Git versus GitHub

    GitGitHub
    What it isSoftware installed on your computerA website and online service
    Main jobTracks changes in a project folderHosts Git projects online and adds collaboration tools
    Works offline?Yes, almost everythingNo, needs internet
    CostFree and open sourceFree plan available; paid plans add features
    Alternatives(Git is the standard)GitLab, Bitbucket, and others

    A simple comparison: Git is like the camera that takes photos of your project; GitHub is like an online album where you store and share those photos.

    Key words you will meet

    • Repository (repo): a project folder that Git is tracking. Git stores its data in a hidden .git folder inside it.
    • Commit: a saved snapshot of your project with a short message, such as "Add contact section".
    • Staging area: a waiting area where you choose which changes go into the next commit.
    • Branch: a separate line of work. The main branch is usually called main.
    • Merge: combining the changes from one branch into another.
    • Remote: a copy of the repository somewhere else, usually on GitHub. The default remote is called origin.
    • Push and pull: send your commits to the remote, or bring the remote's new commits to your computer.
    • Pull request (PR): a request on GitHub to review and merge changes from one branch into another.

    The three areas of Git

    Understanding this picture makes every later command easier.

    1. Working directory: the files you see and edit in your folder.
    2. Staging area: changes you have marked with git add to include in the next snapshot.
    3. Repository: the history of commits, saved with git commit.

    A typical cycle is: edit files, git add the ones that are ready, then git commit with a message. You will do this many times a day.

    Who uses Git?

    Software developers use Git every day, but so do data analysts (for SQL and Python scripts), web designers, technical writers and students submitting projects. Many open-source projects, including tools you may already use, are developed in public on GitHub. A tidy GitHub profile with small, real projects is a practical way for freshers to show their skills, alongside a resume.

    What Git is not

    • Git is not a cloud drive like Google Drive. It does not save automatically; you decide when to commit.
    • Git works best with text files (code, HTML, Markdown, CSV). It can store images and Word files, but it cannot show line-by-line changes inside them.
    • GitHub is not only for experts. Beginners are welcome, and making mistakes in your own practice repository is how everyone learns.

    Key points

    • Git tracks changes locally; GitHub hosts repositories online.
    • A commit is a snapshot; a branch is a separate line of work.
    • Changes move from the working directory to the staging area to the repository.

    Practice task

    1. Look at a project or assignment folder on your computer. Count how many "final" or duplicate copies of files it has, and note what problems this caused.
    2. Write the meanings of these words in your own language or in English: repository, commit, staging area, branch, merge, remote, push, pull.
    3. Draw the three areas of Git (working directory, staging area, repository) on paper with arrows labelled git add and git commit.
    4. Visit github.com and browse one public project in a topic you like. Find its README, its list of commits and its branches. You will learn what each one means in this course.
  • Installing and Configuring Git Free preview30 min

    Installing Git

    Download Git only from the official website, git-scm.com, or your system's official package manager. Avoid "Git installer" downloads from other sites.

    Windows

    1. Go to git-scm.com and download Git for Windows.
    2. Run the installer. The default options are fine for beginners, but read two screens carefully.
    3. On the default editor screen, choose an editor you know, such as Notepad or VS Code, instead of Vim if you are unsure.
    4. On the initial branch name screen, if it is shown, choose the option to override the default and type main.
    5. Finish the installation. You now have Git Bash, a terminal for Git commands. You can also use Command Prompt, PowerShell or the terminal inside VS Code.

    macOS

    Open Terminal and type git --version. If Git is not installed, macOS offers to install the Command Line Developer Tools, which include Git. Alternatively, install it with Homebrew: brew install git.

    Linux

    Use your distribution's package manager. On Ubuntu or Debian:

    sudo apt update
    sudo apt install git

    Check the installation

    Open a terminal and type:

    git --version

    You should see something like git version 2.x.x. The exact number does not matter for this course. If you see "command not found" or "'git' is not recognized", close and reopen the terminal, or restart the computer, and try again.

    Configure your name and email

    Every commit records who made it. Tell Git your name and email once per computer:

    git config --global user.name "Asha Verma"
    git config --global user.email "asha@example.com"

    Use your real name (or the name you want on your public work) and the email you will use for GitHub. --global means "for every repository on this computer".

    Privacy tip: commits pushed to GitHub show this email publicly. GitHub offers a private noreply email address in its email settings that you can use instead. Look for the option to keep your email private in your GitHub account settings.

    Set the default branch name

    Older Git versions name the first branch master; GitHub and most new projects use main. Set main so your projects match GitHub:

    git config --global init.defaultBranch main

    Choose your editor

    Git sometimes opens an editor, for example to write a merge message. If you use VS Code:

    git config --global core.editor "code --wait"

    If you skip this, Git may open Vim. If you ever get stuck in Vim, press Esc, type :wq and press Enter to save and exit.

    Line endings on Windows

    Windows and macOS/Linux end lines of text differently. Git for Windows handles this automatically with its recommended setting, so beginners rarely need to change anything. If teammates on different systems see every line marked as changed, search for "git core.autocrlf" in the official Git documentation.

    Check your settings

    git config --global --list

    Example output:

    user.name=Asha Verma
    user.email=asha@example.com
    init.defaultbranch=main
    core.editor=code --wait

    To change a setting, run the same git config command again with the new value.

    Basic terminal commands you need

    Git is used from a terminal, so learn these few commands first:

    TaskWindows (Git Bash), macOS, LinuxWindows Command Prompt
    Show current folderpwdcd
    List fileslsdir
    Enter a foldercd foldernamecd foldername
    Go up one foldercd ..cd ..
    Make a foldermkdir myprojectmkdir myproject

    Tip: avoid spaces in folder names for your projects (my-website, not my website). It saves typing quotes in commands.

    Get help

    Every command has built-in help:

    git help commit
    git commit -h

    The first opens the full manual; -h shows a short summary in the terminal.

    Common mistakes

    • Typing your name without quotes when it has a space: git config --global user.name Asha Verma saves only "Asha". Use quotes.
    • Using a different email from your GitHub account, so your commits are not linked to your profile.
    • Running commands in the wrong folder. Check with pwd before you start.

    Key points

    • Install Git from git-scm.com or your package manager.
    • Set user.name, user.email and init.defaultBranch main once per computer.
    • Learn pwd, ls, cd and mkdir to move around the terminal.

    Practice task

    1. Install Git and run git --version. Note the version number.
    2. Configure your name, email and default branch main.
    3. Set your preferred editor.
    4. Run git config --global --list and check all values are correct.
    5. In the terminal, create a folder called my-website inside your Documents folder and move into it with cd. You will use it in the next lesson.
  • Your First Repository: init, add and commit 40 min
02History, Branches and Merging 3 lessons
  • Viewing History and Undoing Changes 40 min
  • Working with Branches 35 min
  • Merging and Resolving Conflicts 40 min
03Working with GitHub 3 lessons
  • Creating a GitHub Account and Your First Push 40 min
  • Clone, Pull and Staying in Sync 35 min
  • Pull Requests and Collaboration 40 min
04Good Habits and Publishing 4 lessons
  • .gitignore and Keeping Secrets Out of Git 35 min
  • Writing a Good README 30 min
  • Publishing a Website with GitHub Pages 40 min
  • Final Exam 20 min

About this course

Why learn Git and GitHub?

Git is a version control system: it records every change you make to your files, so you can see what changed, go back to an earlier version and work on new ideas without breaking what already works. GitHub is a website where you store Git projects online, share them and collaborate with others.

Almost every software team uses Git, and many employers look at a candidate's GitHub profile. Even if you are a student building your first website, a Python learner or a teacher sharing notes, Git keeps your work safe and organised.

How you will learn

Every lesson uses the same small project: a personal web page. You will type real commands in the terminal, see what Git prints and fix the common mistakes beginners make. A free GitHub account and any Windows, macOS or Linux computer are enough; a low-cost laptop is fine.

What you will build

By the end you will have a project on GitHub with a clean history, a branch merged through a pull request, a helpful README and a live website published free with GitHub Pages, which you can add to your resume.

Requirements

  • Basic computer skills: creating folders, files and using a text editor
  • A Windows, macOS or Linux computer with internet access
  • A free GitHub account (you will create one in the course)
  • No programming experience needed; basic HTML helps but is not required

Earn a verifiable certificate

Pass the final online exam (20 minutes, 15 questions, pass mark 40%) to receive your certificate instantly. Each certificate has a unique number and QR code for instant verification.

This is an independent, institute-issued skill-training certificate — not a government-recognised degree or diploma.

Your educator

M

Muninder Singh

Frequently asked questions

Are Git and GitHub the same thing?
No. Git is free software that runs on your computer and tracks changes. GitHub is an online service that hosts Git repositories and adds collaboration features. GitLab and Bitbucket are similar services.
Do I need to be a programmer to learn Git?
No. Git works with any text files: code, web pages, notes or documentation. This course starts from zero and explains every command.
Is GitHub free?
GitHub offers a free plan with public and private repositories, which is enough for this course. Paid plans add extra features. Check github.com for current plan details.
Should I use the command line or a GitHub desktop app?
This course teaches the command line because it works the same everywhere and is what interviews and job tasks expect. Once you understand the commands, graphical tools such as GitHub Desktop or the Git features in VS Code become easy.
Is the certificate free?
Yes. Pass the final exam with 40% or more to download a free GCI EDU skill certificate. It is an institute-issued training certificate, not a government-recognised degree.

Have a question about this course?

Leave your details and our team will get back to you, usually within one working day.

Share a phone number or an email so we can reach you. We never share your details.

You may also like

Free

Includes certificate

Enrol free