DEV Community

Cover image for What I Learned About Version Control: Git & GitHub
PHILIP KAPLONG
PHILIP KAPLONG

Posted on

What I Learned About Version Control: Git & GitHub

Introduction

Last week i had the chance of a attending a version control class and this is what i learnt.Before Git and GitHub, people used to save multiple copies of the same project whenever I made changes.The folders would quickly fill up with files like project_final, project_final_v2, and project_final_latest. This approach worked for small projects, but it became confusing and inefficient as projects grew.

I discovered that version control is not just for professional software developers—it is an essential skill for anyone writing code, analyzing data, or collaborating on projects. In this article, I share the major concepts I learned and why they matter.

Understanding Version Control

Version control is a system that records changes made to files over time. Instead of creating multiple copies of the same project, it keeps a history of every change, making it easy to review previous versions or restore them if something goes wrong.

Git is a version control system that runs on your computer. It tracks changes, records project history, and allows you to manage different versions of your files.

GitHub, on the other hand, is an online platform that hosts Git repositories. It allows developers to store their projects in the cloud, collaborate with others, and back up their work.

In simple terms, Git manages your project's history, while GitHub provides a place to share and collaborate on that history.

Getting Started with Git

Setting up Git was straightforward. After installing Git, I configured my username and email so that every commit would be associated with my identity.

I also learned how to navigate the terminal using basic commands to create folders, move between directories, and list files. Although using the command line felt unfamiliar at first, it quickly became a faster way to work with projects.

Creating my first repository using git init helped me understand that Git starts tracking a project from the moment it is initialized.

The Git Workflow

The Git workflow was one of the most important concepts I learned.

Every change follows a simple process:

  • First, I make changes to files in my working directory.
  • Next, I stage the changes using git add.
  • Finally, I save a snapshot of those changes using git commit.

Commands such as git status became extremely useful because they showed which files had been modified, staged, or were ready to be committed.

Understanding this workflow made Git much less intimidating and helped me appreciate how organized version control can be.

Working with GitHub

After learning Git locally, I connected my repository to GitHub. This allowed me to upload my projects and access them from anywhere.

I also learned the difference between pushing and pulling changes. Pushing uploads my local commits to GitHub, while pulling downloads the latest updates from GitHub to my local machine.

Another concept that initially confused me was the difference between forking and cloning. I eventually understood that forking creates my own copy of someone else's repository on GitHub, while cloning downloads a repository from GitHub onto my computer so I can work on it locally.

Branches and Collaboration

Branches introduced me to a safer way of developing projects.

Instead of making changes directly to the main branch, I can create a separate branch for a new feature or experiment. Once everything works correctly, the branch can be merged back into the main project.

This approach reduces the risk of breaking existing code and allows multiple people to work on different features simultaneously.

Although merge conflicts can happen when two people edit the same part of a file, Git provides tools to resolve them and continue working.

Essential Git Commands

Throughout my learning journey, several commands became part of my daily workflow:

  • git init – Create a new Git repository.
  • git status – Check the current state of the repository.
  • git add – Stage changes.
  • git commit – Save changes to the repository history.
  • git log – View previous commits.
  • git clone – Copy a repository from GitHub to a local machine.
  • git push – Upload local commits to GitHub.
  • git pull – Download the latest changes from GitHub.
  • git branch – View or create branches.
  • git merge – Combine changes from different branches.

Key terms that i Learnt

  • Repository (repo) - A project folder that Git is tracking
  • Commit - a saved snapshot of your project at point in time, with a message describing what you changed
  • Staging area - “waiting room” where you choose exactly which changes will go into the next commit
  • Remote - a copy of your repo hosted somewhere (GitHub)
  • Clone - downloading a copy of a remote repo to your computer
  • Branch - a separate, parallel line of work.
  • Pull - downloading new changes from Github (remote) into your computer
  • Push - Uploading your commits from your computer to GitHub
  • Pull request (PR) - is a request to merge your branch’s changes into another branch, with a chance for other to review first
  • Merge - combining the changes from one branch into another.

Key Takeaways

Learning Git and GitHub has been one of the most valuable steps in my software development journey. I now understand how to track changes, organize projects, collaborate with others, and safely experiment without worrying about losing my work.

The biggest lesson I learned is that version control is not just about saving code it is about building a reliable workflow. Whether working alone or with a team, Git and GitHub make project management more efficient, organized, and professional.

As I continue learning data analytics, I know that Git and GitHub will remain essential tools in every project I build.

Top comments (0)