DEV Community

Cover image for Git for Data Analysts: My First Beginner Guide (Git Bash + GitHub Step-by-Step)
Charles
Charles

Posted on • Edited on

Git for Data Analysts: My First Beginner Guide (Git Bash + GitHub Step-by-Step)

Data Science & Data Engineers

Hi, I’m Charles Ndungu.

I recently started learning data science and analytics, and one tool that kept appearing everywhere was Git. At first, Git felt intimidating — lots of commands, confusing terminology, and unclear workflows.

So I decided to learn it step by step and document my experience.

This article walks through my very first Git workflow, from creating a local project to pushing it to GitHub.

If you're a beginner in data science, analytics, or engineering, this guide should help you get started.

Practice repository
Repo: https://github.com/Charles-Ndungu/GIT-basics-practice

Why Git Matters (Especially for Data Work)

Even if you're mainly working with Python, SQL, Power BI, or Excel, Git quickly becomes essential.

Here’s why:

  1. Reproducibility - You can return to any previous version of your project.
  2. Collaboration - Multiple people can work on the same project safely.
  3. Safety - You can experiment without losing working code.
  4. Professional Standard - Most modern data teams expect Git knowledge.

The Simple Mental Model

Before touching commands, this mental model helped me a lot.

Concept Meaning
Local folder Your project on your computer
Git The system that tracks changes
Commit A saved snapshot of your project
Remote The online copy (GitHub)
Push Upload your work
Pull Download updates

The basic workflow is:

init → add → commit → push → pull
Enter fullscreen mode Exit fullscreen mode

Once you understand this cycle, Git becomes much easier.

What You’ll Need

To follow along:
• Windows computer (this guide uses Git Bash)
• GitHub account
https://github.com
• Git installed
https://git-scm.com/downloads
• (Optional) VS Code or another editor

Step 1 — Install Git

Download Git from:
https://git-scm.com/downloads

  • Run the installer and accept the default settings.
  • Once installed, open Git Bash from the Start Menu.

Step 2 — Configure Git (One Time Only)

Git needs your identity for commits.
Open Git Bash and run:

git --version

git config --global user.name "Your Name"
git config --global user.email "you@example.com"

git config --list
Enter fullscreen mode Exit fullscreen mode

This sets your global configuration.

Step 3 — Create Your First Local Git Project

These are the exact commands I used.

# create a project folder
mkdir ~/git-basics-practice

# enter the folder
cd ~/git-basics-practice

# create a simple file
echo "hello from git bash" > hello.txt

# initialize git
git init

# check project status
git status

# stage the file
git add hello.txt

# create first commit
git commit -m "Add hello.txt"

# view history
git log --oneline
Enter fullscreen mode Exit fullscreen mode

At this point, Git is tracking your project locally.

Step 4 — Create a GitHub Repository

Now we connect the project to GitHub.

On GitHub:

  1. Click + → New Repository
  2. Repository name:
git-basics-practice
Enter fullscreen mode Exit fullscreen mode

Important:
Do NOT initialize with README or .gitignore.

Copy the repository URL.
Example:

https://github.com/your-username/git-basics-practice.git
Enter fullscreen mode Exit fullscreen mode

Step 5 — Push the Project to GitHub

Back in Git Bash:

git remote add origin https://github.com/your-username/git-basics-practice.git

git branch -M main

git push -u origin main
Enter fullscreen mode Exit fullscreen mode

If successful, your project will now appear on GitHub.

Important Authentication Note

GitHub no longer allows account passwords when pushing from the command line.
You must use either:

Personal Access Token (PAT)
SSH authentication

Personal Access Token (PAT)

Generate a token from GitHub and use it instead of your password.
or

SSH Keys (Recommended)

Generate an SSH key:

ssh-keygen -t ed25519 -C "you@example.com"
Enter fullscreen mode Exit fullscreen mode

Then add the public key to:

GitHub → Settings → SSH and GPG keys
Enter fullscreen mode Exit fullscreen mode

Step 6 — Pulling Changes

If someone updates the repository, or you edit directly on GitHub, download the changes using:

git pull origin main
Enter fullscreen mode Exit fullscreen mode

Git Command Cheat Sheet

These commands are enough to start using Git comfortably.

git init                 start tracking a folder
git status               check project state
git add <file>           stage file
git commit -m "message"  save snapshot
git log --oneline        view commit history
git remote -v            show remote repositories
git push -u origin main  upload commits
git pull origin main     download changes
git checkout -b name     create new branch
Enter fullscreen mode Exit fullscreen mode

A Real Beginner Mistake I Made

  • When I first pushed my repository, Git said the push was successful.
  • But when I opened the repo in the browser I got a 404 error.
  • After some debugging, I discovered the issue:
  • My remote URL accidentally had an extra dot at the end:
GIT-basics-practice..git
Enter fullscreen mode Exit fullscreen mode

Git accepted the push, but the browser link didn’t match the repository name.
If you encounter a 404 error, check your remote using:

git remote -v
Enter fullscreen mode Exit fullscreen mode

Small typos in URLs can cause confusing errors.

Key Takeaways

If you remember only three things about Git:
git init starts tracking a project
git commit saves a snapshot
git push uploads your work to GitHub

Once you understand this cycle, Git becomes much easier.

Data Analysis Learning Path

1. Git & Version Control  
2. Excel for Data Analysis  
3. Data Modeling  
4. Power BI Dashboards  
5. SQL for Data Analysis
Enter fullscreen mode Exit fullscreen mode

Data Analysis Step by Step;

1st Read: Git & Github Beginner's guide

If you’re also learning version control with Git, you can read my Git & GitHub beginner’s guide here:
https://dev.to/charles_ndungu/git-for-data-scientists-data-engineers-my-very-first-beginner-guide-git-bash-github-3952

2nd Read: Mastering Excel

After mastering Git basics, you can learn how to analyze data using Microsoft Excel here:
https://dev.to/charles_ndungu/ms-excel-for-data-analytics-a-friendly-practical-guide-for-beginners-hjn

3rd Read: Data Modelling & Schemas

This article dives into data modelling in Power BI, covering star and snowflake schemas, fact and dimension tables, relationships, and why good modelling is essential for accurate insights and fast reports.
https://dev.to/charles_ndungu/the-backbone-of-power-bi-a-deep-dive-into-data-modeling-schemas-1o1l

4th Read: Data Analysis Steps in Power BI

This article reveals how Power BI analysts act as data translators, bridging the gap between messy data and clear business action. We break down their essential three-step process: cleaning raw information, encoding logic with DAX, and designing dashboards that drive real decisions.
https://dev.to/charles_ndungu/from-raw-data-to-real-action-the-analysts-journey-as-a-data-translator-in-power-bi-2gl6

5th Read: From Tables to Insights – A SQL Masterclass

Data lives scattered across tables—customers here, products there, sales everywhere. This article is your guide to bringing it all together. Follow along with a real online store dataset as we build queries that rank top customers, spot sales trends, and uncover hidden patterns. By the end, you won't just write SQL—you'll tell stories with data.
https://dev.to/charles_ndungu/mastering-sql-joins-and-window-functions-a-practical-guide-with-an-e-commerce-dataset-ejg

Repo

https://github.com/Charles-Ndungu/excel-for-data-analytics

Top comments (0)