As someone who works with reports and data, with completely zero experience in data analytics and data science, Git and GitHub initially felt unfamiliar to me. I was used to working with documents, spreadsheets, reports, and data, but I had never used version control or the command line before.
As I started learning Git and GitHub, I realized that these tools can help me organize, track, and manage data-related projects. I decided to put what I learned into practice by creating a simple personal project and taking it from a local folder on my computer to GitHub using Git and SSH.
Rather than just documenting the commands, this article shares what I actually did, what each step means, the challenges I encountered, and what I learned along the way.
Introduction to Git and Git Hub
Git - A version control system that tracks changes to files and keeps a history of those changes as projects develop.
GitHub- A cloud-based platform that hosts Git repositories and allows people to store, manage, share, and collaborate on projects.
_Comparison of the two : _
Git is the tool that tracks changes in your project, while GitHub is the online platform where you can store and share that project
Step 1: Installing the Required Tools and Applications
Before starting my project, I first installed and prepared the tools required to work with Git and GitHub.
The main tools I needed were Git, Git Bash, Visual Studio Code (VS Code), and a GitHub account
Step 2: Setting Up Git and Creating an SSH Key
After installing Git, I opened Git Bash, which provides a command-line interface for interacting with Git and navigating files on my computer.
I then configured my Git identity using my name and email address.
After configuring Git, the next step was to connect my local computer to GitHub. I generated an SSH key using Git Bash and then added my public key to my GitHub account. This allowed me to establish a secure connection between my local Git environment and GitHub.
Step 3: Creating a project folder
I created a folder by running this commands:
Run pwd- to confirm location
Run ls - to see folders available
Run cd "Desktop"- the chosen location to create the project folder
Run ls - to check content of the Desktop folder
Run mkdir my-data-project - to create folder
Step 4: Create files inside the project folder
I created three subfolders to organize my project: Data, Scripst and notebooks
run mkdir data
run mkdir scripts
run mkdir notebook
run touch README.md
Step 5: Add content to the file folders
For README file
run code README.md
This opened the file in VS Code, where I added information about the project, its purpose, and the project structure.
For data file
I copied the data received in class and pasted in the folder
then run ls of the data folder to see the data file uploaded
Step 6: Add and Commit Files
Check Git status:
run git status
Stage all project files:
rungit add .
Create the first commit:
run git commit -m "Initial project setup"
Verify:
run git status
Step 7: Creating a a GitHub Repository
Open GitHub
Create a newrepository and name it Kenya-Hospital-Records-2
Copy the ssh code generated and run it on Gitbash
Check the connection by running git remote -v
Run git branch -M main - to rename branch to main
Run git push -u origin main to push the project to GitHub
The git push command uploads my local commits to the remote repository. origin refers to my GitHub repository, while main is the branch I am pushing.
The project was added successfuly:

Challenges I encountered as a first time using Git and Gitbash
• Navigating folders using Git Bash.
• Understanding Git commands.
• Setting up SSH authentication.
• Connecting the local repository to GitHub.
_ What I learned _
This practical exercise helped me understand how Git and GitHub work together. I learned how to create a local project, organize files, initialize a Git repository, stage and commit changes, create an SSH connection, connect my local repository to GitHub, and push my project online.
More importantly, I learned that Git is not just about memorizing commands. Understanding what each command does makes it easier to troubleshoot errors and manage projects effectively. As I continue learning data analytics and data science, I can see how Git and GitHub will help me organize my projects and track my work over time.
Top comments (1)
Congratulations on getting it pushed. That first successful
git pushis a genuinely good feeling. And explaining what each command does rather than just listing them makes this more useful than most tutorials out there.One habit worth building now, since you're heading into data work. Be careful what ends up in the
data/folder of a repo. Class datasets are usually fine, but the same workflow with real records is where people get caught out, and the awkward part of Git is that history is permanent. Deleting a file in a later commit doesn't remove it from the repository, because the earlier commit still holds it. Anyone who clones can walk back and find it.What prevents that is a
.gitignoreat the project root, created before your first commit:Then put a README inside
data/saying where the real data lives, or commit a tiny sample instead. Your project structure still reads clearly to anyone browsing, and nothing sensitive travels with it.Related:
git add .stages everything in the folder, including files you didn't intend. Runninggit statusbefore every commit is the reflex that catches it, and you're already doing that.Two smaller ones:
ssh -T git@github.comtests your SSH setup on its own. Since SSH was one of your challenges, that tells you immediately whether the key works, before a failed push confuses the issue.git config --global init.defaultBranch mainmakes main the default, so you won't needgit branch -M mainon future projects.Good first post. Keep them coming.