Skip to content

Installing Git and Creating a GitHub Account

This guide provides simple, step-by-step instructions for installing Git on Windows, Linux, and macOS, and creating a GitHub account.

Part 1: Installing Git

Git is a version control tool that tracks changes in your files. Below are instructions for installing Git on different operating systems.

Installing Git on Windows

  1. Download Git:

    • Go to git-scm.com.
    • Click the link to download the latest Git installer for Windows (e.g., "64-bit Git for Windows Setup").
  2. Run the Installer:

    • Double-click the downloaded file (e.g., Git-2.x.x-64-bit.exe).
    • Follow the setup wizard and choose these options:
    • License Agreement: Click "Next".
    • Select Destination Location: Keep the default path (e.g., C:\Program Files\Git) and click "Next".
    • Select Components: Check these options:
      • "Git Bash Here" (to use Git in folders).
      • "Git GUI Here" (optional, for a graphical interface).
      • Keep other defaults and click "Next".
    • Select Start Menu Folder: Keep default and click "Next".
    • Choosing the Default Editor: Select "Use Visual Studio Code" or "Notepad" for simplicity, then click "Next".
    • Adjusting the PATH Environment:
      • Choose "Git from the command line and also from 3rd-party software" (this allows you to run git commands from Command Prompt or PowerShell).
      • Click "Next".
    • Choosing HTTPS Transport Backend: Select "Use the OpenSSL library" (for secure connections) and click "Next".
    • Configuring Line Ending Conversions:
      • Choose "Checkout Windows-style, commit Unix-style line endings" (recommended for cross-platform compatibility).
      • Click "Next".
    • Configuring the Terminal Emulator:
      • Choose "Use MinTTY (the default terminal of MSYS2)" (this enables Linux-like commands in Git Bash).
      • Click "Next".
    • Choosing the Default Behavior of git pull:
      • Select "Default (fast-forward or merge)" and click "Next".
    • Choose a Credential Helper: Keep the default ("Git Credential Manager") and click "Next".
    • Configuring Extra Options:
      • Check "Enable file system caching" and "Enable symbolic links" (optional, for advanced use).
      • Click "Next".
    • Experimental Options: Skip these (leave unchecked) and click "Install".
    • Click "Finish" when the installation is complete.
  3. Verify Installation:

    • Open Git Bash (search for it in the Start menu).
    • Type git --version and press Enter. You should see something like git version 2.x.x.
    • You can now use Git commands in Git Bash, Command Prompt, or PowerShell, and Linux-like commands (e.g., ls, pwd) in Git Bash.

Installing Git on Linux

  1. Open a Terminal:

    • Press Ctrl + Alt + T to open the terminal.
  2. Install Git:

    • For Ubuntu/Debian:
    sudo apt update
    sudo apt install git
    
    • For Fedora:
    sudo dnf install git
    
    • For Arch Linux:
    sudo pacman -S git
    
  3. Verify Installation:

    • Type git --version and press Enter. You should see something like git version 2.x.x.

Installing Git on macOS

  1. Check if Git is Already Installed:

    • Open the Terminal (search for it using Spotlight or find it in Applications > Utilities).
    • Type git --version and press Enter.
    • If Git is installed, you’ll see a version number. If not, macOS will prompt you to install it.
  2. Install Git (if not already installed):

    • Option 1: Using Homebrew (recommended):

      • Install Homebrew if you don’t have it:
      /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
      
      • Install Git:
      brew install git
      
    • Option 2: Download from git-scm.com:

      • Go to git-scm.com.
      • Download the macOS installer.
      • Double-click the downloaded file and follow the installation prompts.
  3. Verify Installation:

    • In the Terminal, type git --version and press Enter. You should see something like git version 2.x.x.

Part 2: Creating a GitHub Account

GitHub is an online platform where you can store your Git projects and collaborate with others.

  1. Go to GitHub:

  2. Sign Up:

    • Click the "Sign up" button (usually in the top-right corner).
    • Enter your email address and click "Continue".
    • Create a password (make it strong, e.g., mix letters, numbers, and symbols).
    • Enter a username (this will be your public GitHub handle, e.g., coolcoder123).
    • Answer the verification question (e.g., "Are you a robot?") and click "Continue".
    • Verify your email by entering the code sent to your email address.
  3. Set Up Your Account:

    • Choose the free plan (suitable for beginners).
    • Fill out the optional profile questions (e.g., your interests) or skip them.
    • Click "Complete setup".
  4. Verify Your Account:

    • Check your email for a confirmation link from GitHub and click it to verify your account.

Part 3: Configure Git

  • Open Git Bash (Windows), Terminal (Linux/macOS).
  • Set your name:

    git config --global user.name "Your Name"
    
  • Set your email (use the same email as your GitHub account):

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

Tips for Beginners

  • Git Bash (Windows): Use this for Git commands and Linux-like commands (e.g., ls instead of dir).
  • Help: If you get stuck, search for Git tutorials or ask on GitHub’s community forums.