Why learn to use Git?

Why learn to use Git?

Francisco

-
Follow me on
linkedin icongithub icon
Published on Nov 14, 2025

Git is one of the most powerful tools in software development. It is generally learned through practice, and it is rarely taught in depth in bootcamps or universities. Git was born from the need for a tool that could simplify software creation by separating design from logic (code) and making maintenance and versioning easier.

Back in the 2000s, web apps were hosted on servers where code was uploaded directly via FTP, without version control and without the possibility of multiple teams working together. This process looked like the following image:

200.png

In those days, developers had to upload code to a server folder using SFTP, without any real security. In addition, if the server failed, the entire application went down with no redundancy. Some of the problems with this way of working were:

  • Difficult to maintain
  • No separation between design and logic within the same file
  • No scalability: a single server held everything, and there were no backups
  • If one thing failed, everything failed
  • Manual and slow updates

From this pain point, Git emerged—a version control system that companies like GitHub, GitLab, and Bitbucket have made popular in software development.

But is it important to know?
Yes. Anyone who works with data, software development, or technology in general (actually doing hands-on work) should understand Git—especially GitHub, which is the most popular platform and is used by nearly all companies to store, maintain, and version their code.

Is it difficult?
Not really. Almost all commands and instructions are well-known by language models, so it’s not necessary to memorize them. What is important is understanding the fundamentals and knowing how to find what you need when you have doubts (in the documentation or with AI assistants).

Based on my experience, I wanted to share the things I’ve used the most in Git: from basic commands and merges to CI/CD.

Basic commands
Before starting anything, you have two options: build your code from scratch or clone an existing repository and begin from there. In this case, the article will show the second option—cloning a repository created specifically for this exercise. To do that, you need to run the following command in your computer's terminal:

This command copies the remote repository (from GitHub) to your local computer in the directory where the instruction was executed. If you want to access the folder, you must use the cd command along with the folder name. After entering the folder, you normally run the git status command, which shows the current state of your Git project (branch, files, etc.).

Typically, any adjustment or change to the code should be made in a different branch, in order to avoid modifying code that is in productive branches. In this case, a new branch called "feature-substract" was created, whose main purpose is to add another endpoint to the repository that allows subtracting two integers. This is done using the following command:

This command will create a new branch called “feature-substract” and will immediately switch you to that branch. If you need to confirm that you are in the correct branch, you can run the git status command again.
In this branch, two main adjustments were made: an endpoint that subtracts two numbers and its corresponding schema in the models folder. These changes were as follows:

After adjusting the main.py and schema.py files locally, these modifications exist only on my computer, not in the remote branch. Therefore, these changes must be pushed to the remote branch. This is done by executing the add command using the following expression:

The command adds the changes to the staging area, meaning it prepares the files to be included in the next commit. If we want to perform the commit, we must run the following command.

A new commit is created, and a short descriptive message is added so that others can understand what the change is about. If you want to push the change to the remote branch, you must run the following command:

CI/CD

CI/CD is a fundamental practice in software development that enables continuous integration and continuous evolution of an application. Today, this approach is used in virtually every software project, as it helps prevent errors from being replicated in production and saves time for development teams. This is achieved by deploying changes to different environments (production, QA, testing) without the need to manually update servers or resources—simply by pushing changes to the remote repository branch.

Within this practice, there are two key concepts:

  • Continuous Integration (CI): Responsible for reviewing the code, installing the necessary libraries, and running automated tests.
  • Continuous Deployment (CD): Responsible for deploying code changes to the application's services or infrastructure.

Since this repository is not deployed on any particular application, I will show an example related to testing (CI). However, these files are simply sets of instructions and are not very difficult to create, especially with the help of AI agents. It is important to remember that GitHub recognizes these files only if they are stored in a folder named .github, located at the root of the repository, specifically within a subfolder called workflows.

In this directory, you must store the ci.yml and cd.yml files. In this case, the ci.yml file is as follows:

This file, in simple terms, is a set of instructions where the main tasks are installing libraries and running the tests defined in your program.

Environment Variables (Secrets)

One of the most important things to understand is the need to handle secrets carefully, especially when dealing with database credentials or third-party services. Secrets should never be hardcoded or stored in a .env file directly inside the GitHub repository.

For this reason, these platforms provide mechanisms to add secrets through the repository’s interface, preventing unauthorized individuals from accessing them while still allowing your code to use them safely during development.

In any GitHub repository, in the upper-right corner, you will find a section called Settings.

settings.png

If you click there, in the Security section—specifically under “Secrets and variables”—you will find the following:

variables.png

Final

I believe GitHub is mostly about practice and getting used to a few essential platform commands. I feel that for anyone working with data, it is very important to master it, because it is rarely taught in universities or bootcamps, yet employers often expect candidates to be familiar with these practices. A good way to learn is to use it constantly, so my best advice is to use GitHub both for your personal projects and at work.

The repository for this article is:
https://github.com/Foco22/small-github-api

Ir arriba