Git for Data Scientists & Data Engineers — my very first beginner guide (Git Bash + GitHub)
Source: Dev.to
Hi, I’m Charles Ndungu. I recently started learning data science and analytics. I’ve never used Git before, but I wanted to share my very first experience with Git and GitHub, step‑by‑step, so other beginners like me can follow along.
Repo:
TL;DR
Git tracks changes to files. GitHub stores your tracked projects online. Learn the basic flow:
init → add → commit → push → pull
That’s enough to start working confidently and share work with others.
Why Git matters (short)
- Reproducibility – you can go back to any previous version.
- Collaboration – multiple people can work without overwriting each other.
- Safety – experiment on branches, revert mistakes.
- Professional – it’s expected in data teams.
What you’ll need
- Windows (these steps use Git Bash) – macOS/Linux users can use Terminal.
- A GitHub account
- Git Bash installed
- (Optional) VS Code to edit files
Very simple mental model
| Concept | Explanation |
|---|---|
| Local folder | Your project on your computer |
| git | The tool that watches the folder and remembers changes |
| commit | A saved snapshot |
| remote (origin) | The GitHub copy of your project |
| push | Upload your commits to GitHub |
| pull | Download changes from GitHub |
Step 1 — Install Git Bash (Windows) — quick
- Download from the official site → pick Windows.
- Run the installer → accept defaults. When asked, choose OpenSSH.
- Open Git Bash from Start → Git → Git Bash.
Step 2 — Minimal setup (one‑time)
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
Step 3 — First local project — the exact commands I ran
# create project folder and enter it
mkdir ~/git-basics-practice
cd ~/git-basics-practice
# create a tiny file
echo "hello from git bash" > hello.txt
# start Git in this folder
git init
# check status
git status
# track the file
git add hello.txt
# save a snapshot
git commit -m "Add hello.txt"
# check history
git log --oneline
Step 4 — Create a GitHub repo & push (real moment)
- On GitHub click + → New repository.
- Name it
git-basics-practice. - Do NOT initialize a README or
.gitignore.
Authentication notes
- GitHub no longer accepts account passwords on the command line. Use a Personal Access Token (PAT) instead of your password if prompted.
- Alternatively, set up SSH keys (recommended long‑term): add the public key to GitHub → Settings → SSH and GPG keys.
Push the local repo
git remote add origin https://github.com/your-username/git-basics-practice.git
git branch -M main
git push -u origin main
Troubleshooting — real things I saw (and how to fix)
fatal: User canceled device code authentication– If you close the browser prompt, Git may fall back to asking for username/PAT. Re‑rungit pushand use a PAT or set up SSH.Permission denied (publickey)– SSH key missing on GitHub. Add yourid_ed25519.pubto GitHub → Settings → SSH keys.404when opening the repo in a browser – Check the exact repo name and whether it’s private. I once had an extra.at the end of my remote URL (...git-basics-practice..git), which created a repo name with a trailing dot and gave a confusing 404. Always verify withgit remote -v.
Step 5 — Pulling changes (download)
If someone edits the repo or you edit on GitHub, bring changes down with:
git pull origin main
Short cheat‑sheet (commands to remember)
git init # start tracking a folder
git status # see file status
git add # stage file
git commit -m "msg" # save snapshot
git log --oneline # view history
git remote -v # show remotes
git push -u origin main # upload commits
git pull origin main # download commits
git checkout -b name # create + switch branch
A tiny real lesson (my raw beginner moment)
I pushed successfully, but when I opened my repo in the browser I got a 404. I later discovered my remote URL had an extra dot (git-basics-practice..git) so the repo name ended up with a trailing dot. Git still accepted the push, but the usual browser link (without the dot) returned 404. If you hit 404, run git remote -v and make sure the URL is exactly what you expect.

