A NEWBIE'S GUIDE TO GIT(gitbash).

Published: (January 17, 2026 at 04:35 AM EST)
4 min read
Source: Dev.to

Source: Dev.to

Git

Are you a newbie on Git like me?

Check out this article on how you can install and configure Git (also known as Git Bash) and connect it to your GitHub account on a Windows operating system, using commands and prompts.

Definitions

  • GitHub – A cloud‑based platform that lets you create, store, manage, track, and share code. It enables collaboration on projects.
  • Git / Git Bash – A command‑line version‑control interface that lets you interact with GitHub (or any other remote repository) using prompts and commands.

Fun fact about Git

Git uses the SHA‑1 (and increasingly SHA‑256) cryptographic hashing algorithm to identify every commit. This ensures that the code cannot be altered or corrupted without detection.

Commit – A permanent record of your code at a specific point in time; a checkpoint that can be secured using cryptography.

Now that you know the tools, let’s get started!

How to create a GitHub account

  1. Open your default browser, search GitHub, click the first link, and sign up.
    Or go directly to: https://github.com/join
  2. Fill in the required fields (profile picture, name, bio, etc.).

Congratulations! You have successfully created a GitHub account.

How to install Git / Git Bash

  1. Open your browser and search Git.
    Or follow this link: https://git-scm.com/

  2. Choose your operating system (Windows, macOS, Linux, etc.).

  3. Click the “click here to download” button (see image below).

    Git download

  4. Once the installer finishes downloading, run it.
    Tip: Choose Visual Studio as your default code editor during the installation steps.

Follow each step carefully until the installation completes.

Connecting Git to your GitHub account (using the command line)

  1. Launch Git Bash (or any terminal where Git is available).

  2. Run the following commands in order:

    # Check Git version
    git --version
    # Configure your name and email (use the same ones you used for GitHub)
    git config --global user.name "Your Name"
    git config --global user.email "you@example.com"
    # Verify the configuration
    git config --list
    # Generate an SSH key (your unique digital identity)
    ssh-keygen -t ed25519 -C "you@example.com"
    # Start the SSH agent
    eval "$(ssh-agent -s)"
    # Add the SSH key to the agent
    ssh-add ~/.ssh/id_ed25519
    # Display the public key (to copy it later)
    cat ~/.ssh/id_ed25519.pub
  3. Add the SSH key to GitHub

    • Open the file shown by cat ~/.ssh/id_ed25519.pub in Visual Studio (or any editor) and copy its contents.
    • In GitHub, go to Settings → SSH & GPG keys → New SSH key, paste the key, and save.
  4. Verify the connection

    ssh -T git@github.com

    You should see a message similar to:

    SSH verification

Congratulations! Your Git and GitHub accounts are now linked.

A few more useful Git commands

1. Version control basics

  • Git takes a snapshot of every commit in the entire project.
  • It provides an audit trail: who changed what, when, and why.
  • You can restore any previous version because each commit is stored permanently and unaltered.

2. Pushing and pulling code

  • Pushing – Sends your local commits to a remote repository (e.g., GitHub).

    git add .
    git commit -m "Your commit message"
    git push origin main   # replace 'main' with your branch name
  • Pulling – Retrieves changes from the remote repository and merges them into your local copy.

    git pull origin main   # replace 'main' with your branch name
  • Alternative pull with rebase

    git pull --rebase

These commands let you keep your local work in sync with the shared repository and collaborate smoothly with other developers.

3. Tracking code on Git

Below are a few commands to monitor changes in your working directory:

  • Check the project’s current overall status

    git status
  • View exact code changes

    git diff
  • Check the changes waiting to be committed (staged)

    git diff --staged
  • View full history or logs

    git log
  • Condensed view of your history

    git log --oneline
  • History of a specific file

    git log -- <file>
  • Detailed view of a specific commit

    git show <commit-hash>

Thank you for reading my article to the end!! I hope you find it informative and educational. Please comment and let me know what you think about my article!!

Adios, until the next one.

Signed
Jules.

Back to Blog

Related posts

Read more »

Introduction to Gitbash and Github

Definitions - Git is a widely used, free, and open‑source system designed to handle projects of all sizes. It enables developers to track changes in code and f...

Git and Github for Beginners

What is Git and GitHub? Git is a version control tool that tracks project files, stores the history of all changes, and logs actions taken by everyone connecte...

A BEGINNER'S GUIDE TO GIT

Introduction Git is a free, open‑source version control system that developers and analysts use for tracking changes, collaborating, and managing project histo...