No Git — Coding without weapons?

You can always be a pro developer, but if you don't know how to use git, you and your teammates won't appreciate your pro work!

Divyanshu Garg
3 min readMar 29, 2024

Let's put it this way: the awareness comes from real-life experiences.

I was involved in a Medical project and hired an Angular developer. Since I was new to Angular, it was always a good idea for me to have someone experienced with it. The interview went well; the hire had a vast knowledge of Angular development, and the process was started immediately.

Until…, The first PR was sent. Unrelated histories…

3 branches with 3 different commit histories; I don't know how the hire did it. The code was valid, But the PRs were useless.

Time taken to write the code — 45 mins
Time taken to fix the branching issue — 45 mins

It sounds like a waste of 1:30 hours of life, and that too, for what?

In short, never be that guy…

What is Git? (Generated using ChatGPT)
Oh uh (Generated by ChatGPT)

PS — The hire was fired for failing to learn git principles. Sounds weird, right?

In Team collaboration, it is essential to know at least the basic usage of Git. Failing to comply might not significantly affect you, but it could be a painful experience for fellow team members.

But what's the real problem? Is it not knowing git or something else? Why do you think developers resist understanding the basic idea of using GIT?

There could be a few reasons, and some might be just absurd.

  1. Unwillingness 🙂
    - Well, there is nothing anyone can do about it 🤷‍♂
  2. Horrified about messing up the code.
    - Experimenting is the way to go; we all have been there, messing up some production code.
  3. Never worked in a team.
    - There’s always some room for improvement. Learn and grow.
  4. Not knowing anything about the power of git.
    - Unless you research, you will never know
  5. Failing to find a good learning resource
    - Try to find better and keep experimenting
  6. Finding the simple git workflow complex.
    - Keep reading… Not in general, scroll a little…
Imaginary GIT Tree (Generated by ChatGPT)

Let's turn the imagination and visualization switch ON. Both of those are massive words, but you get the point.

Think of the git structure as a Tree. A typical tree starts from a single stem and grows to multiple stems. Those stems generate their stems, and so on. It's an endless cycle. Now, each stem stick grows its leaves; those leaves could be anything, starting from a bug fix or improvement to a new feature. Eventually, all the leaves are connected to the central tree stem.

Using Git, you can chop any stem or leaf, place it anywhere, and create your own tree (of code 😛). You can also travel to any stem on the tree.

Now, let's throw a hammer on the imaginary glass. The stems are the branches, the leaves are the commits, and the base stem is the main or master branch. (Basing this on a typical scenario, I don't want viewers to shout at me about the custom main branch name… Please don't shout at me!!! 🥺).

Simple logic: Branches consist of commits, which consist of the changes a developer makes, and those branches are merged to eventually reach the main or master branch or some other branch based on the requirements.

And that is how it goes on for life unless the developer dies or the project comes to an end either by completion or the client running away…

The simple use of Git. I won’t go to the part where I explain the git commands one by one, but the idea is to put the idea in the readers' minds of how git can be imagined and made easy to understand. If this worked for even a single developer, that's already a win for me.

Adios! Just for now…

--

--