Skip to main content

Command Palette

Search for a command to run...

Git and Github

Published
7 min read
Git and Github
I

I'm Iniobong Ema, a Cloud and DevOps Engineer, I'm passionate about automation, pipelines and building scalable systems. I document my journey, share tutorials and explore modern tech solutions-one experiment at a time. From Code to Cloud: My DevOps Journey. My contact information: Phone number: 08027604029 Gmail Address: iniema2025@gmail.com, iniakan4real2017@gmail.com

Introduction: Git & GitHub for Windows Users (A Cloud & DevOps Engineer’s Guide)

If you are using Windows and stepping into Cloud or DevOps engineering, Git and GitHub are not just tools you should know — they are tools you must master.

Every real-world DevOps task you will encounter — from Terraform infrastructure, Azure Bicep templates, Dockerfiles, Kubernetes YAMLs, to CI/CD pipelines — is tracked, reviewed, and deployed using Git. Without Git, collaboration breaks down. Without GitHub, automation and team workflows become nearly impossible.

For many Windows users, Git can feel confusing at first:

  • Why do I need Git Bash?

  • What is a repository?

  • Why am I pushing and pulling?

  • What exactly is a branch?

  • Why does Git keep complaining about conflicts?

This guide removes that confusion.

In this blog, I will walk you through Git and GitHub step-by-step specifically for Windows users, using:

  • Git Bash on Windows

  • Simple commands you can copy and run

  • Clear explanations of what each command does and why it matters

  • Practical DevOps-style workflows you’ll actually use on the job

No assumptions. No skipped steps.

By the end of this guide, you will be able to:

  • Install and configure Git correctly on Windows

  • Create and manage Git repositories

  • Track file changes with confidence

  • Make clean commits with meaningful messages

  • Push and pull code between your computer and GitHub

  • Work with branches and Pull Requests like a DevOps engineer

  • Avoid common Windows-specific Git mistakes

Whether you are:

  • A beginner transitioning into Cloud/DevOps

  • A student learning Git for the first time

  • Or a Windows user tired of trial-and-error tutorials

This article is designed to give you clarity, confidence, and practical skills you can immediately apply in real projects.

Prerequisites

  • A Windows 10 or Windows 11 PC

  • Internet connection

  • A GitHub account (free)

Let’s start by setting up Git properly on Windows — the right way.

Step 1: Installing Git on Windows (Correct Method)

Step 1: Download Git

  1. Open your browser

  2. Go to: https://git-scm.com/downloads

  3. Click on Windows

    1. After selecting windows, beneath windows, click on ‘click here to download’

      Step 2: Install Git

      Run the installer and accept default settings.
      Important points to confirm during installation:

      • ✔ Install Git Bash

      • ✔ Use Git from the command line and third-party software

      • ✔ Use OpenSSH

      • ✔ Checkout Windows-style, commit Unix-style line endings

Finish installation.

Step 3: Open Git Bash

After installation:

  • On your windows search bar, type git, select git bash and click on ‘open’

  • Or search for Git Bash in the Start Menu

    The terminal below will be displayed

    • Confirm Git Installation

      In Git Bash, we will run configuration for our name, in the terminal, i will run ‘git --version. The page below must be displayed to ensure proper installation. If Git is installed correctly, you will see a version number as displayed.

      Git is now ready for use.

      Configure Git (Mandatory First Step)

      Git needs to know who you are. Next is to set your name and Gmail. We will run git

      git config --global user.name "Your Full Name"

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

      Set default branch to ‘main’. run this command ‘git config --global init.defaultBranch main’

      confirm configuration by running this command ‘git config --list’

      To change the main branch to git lab, run this command: git-devops-windows/git-lab

    • Step 4. Creating Your First Local Git Repository

      Step i: Create a Project Folder

      run this command ‘mkdir git-devops-windows cd git-devops-windows’

      Step ii: create a directory: run “mkdir git-lab^c”

      step iii: create an empty folder in the directory: run “mkdir git-lab”

      step iv: Change directory : run ‘cd git-lab’

    • To start a new project, you first of all run ‘git init’

      To check create file, run: touch index.html

      To edit the file, run ‘nano index.html. this page will be displayed

      Type what ever you want, when you are done, press control key and letter x simultaneously, then Y on the keyboard and press enter key.

      After pressing the enter key, it will take you back to this page

    • To view the content of the file, run ‘cat index.html’

    • Step 5: Creating a GitHub Repository (Remote Repo)

      • Log in to GitHub: Github.com

      • Click New repository

Give the repository a name, click on ‘create repository’

The page below will be displayed, you will run the highlighted commands

on the terminal, we ran ‘git init’ before. we are running ‘git add index.html’, because we have created that file already.

Next command is ‘git status’ for us to know the status of the vm. This means we are the branch, we have not done any commit yet, we have a new file called index.html and the rest.

To create commit, run ‘git commit -m "first commit"

TO connect the GitHub repo, you run ‘git remote add origin https://github.com/iniema2025-pixel/git-lab.git

Next command is to run “git push -u origin main’

  • The page below will be displayed for you to sign in with. click on ‘sign in with your browser’

  • After Clicking on ‘sign in with your browser’ the page below will be displayed

    After clicking on ‘Authorize git-ecosystem’ the page below will be displayed.

    After clicking on ‘verify via email’ the page below will be displayed. Check your gmail, and enter the verification code, then click on ‘verify’

    The confirmation page will be displayed as shown to show asuccesful authentication.

    To confirm the push, refresh the GitHub app, the commands we have ran already will not be there again as shown below. The file name is shown and the commit'

    Next is to open the ‘index.html’ file by clicking on it. The message we typed is displayed

    Step 6: Git Pull

  • On GitHub browser, click on index.html file, , on the right hand side, click on the pencil icon that says edit this file

  • Add write ups to what we typed before and commit changes (save)

  • After clicking on ‘commit changes’ the page below will be displayed, click on ‘commit changes again’

    If we go back to our git bash, and run ‘git status’ it will show that we are upto date

    Its showing ‘nothing to commit’, we will go back to our bash and run ‘git pull origin main’

    From here, we have seen the changes we made in our file and the likes.

Step 7: Git Push: To push means we are pushing our files from the local to remote repository. type this command ‘git push -u origin main’

Refresh GitHub — your files will appear online.

Step 8. Pulling Changes from GitHub

To download updates from GitHub: run ‘git pull’

Always pull before starting new work.

Step 9: Cloning a Repository on Windows

To copy a GitHub repo to your PC: run this ‘git clone https://github.com/YOUR_USERNAME/git-devops-windows.git

Cloning a repository.

Step 10: Working with Branches (DevOps Workflow)

Create and switch to a branch, run this command, git checkout -b feature/add-ci-pipeline or git switch -c feature/add-ci-pipeline

To view branches, run ‘git branch’

Push branch to GitHub, run ‘ git push -u origin feature/add-ci-pipeline’

Step 11: Pull Requests (PRs) on GitHub

Pull Requests allow teams to review code.

Steps:

  1. Push your branch

  2. Go to GitHub

  3. Click Compare & Pull Request

  4. Add title and description

  5. Create PR

  6. Review → Merge

    Step 12: Updating Local Main Branch After Merge, run this command ‘git checkout main git pull origin main’

    To delete completed branch: run ‘git branch -d feature/add-ci-pipeline’

    Step 13: .gitignore, run ’touch .gitignore’

    Create file:

    Conclusion

    For Windows users entering Cloud and DevOps, mastering Git and GitHub is a career-defining skill.

    Once Git becomes second nature:

    • Collaboration becomes easy

    • Automation becomes reliable

    • Deployments become traceable

    • You work like a professional engineer

This guide gives you a solid foundation. From here, Git will support everything you build in the cloud.

More from this blog

IniDevOpsLab

11 posts