Introduction to Git

Harinath R
3 min readApr 1, 2023

--

Hey everyone, welcome again! So the purpose of the next few posts will be to introduce the concept of git and a few of its commands. I am a huge fan of F.R.I.E.N.D.S.; those who know will be familiar with the format itself, so I will use that as a reference for explaining concepts here.

Understanding Git commands at first was like trying to learn the complicated dance routine from the Friends’ opening credits — it looked easy, but once you got into it, you were left feeling dizzy and confused. It was like trying to comprehend Chandler’s sarcastic jokes, but instead of punchlines, it was all about code lines. It was like trying to follow Joey’s acting career, but instead of scripts, it was all about repositories. However, with time and practice, I learned how to “pivot” my way through Git commands like Ross and Chandler moving a couch up a staircase. And just like how the Friends characters always have each other’s backs, Git helps developers collaborate and support each other in the coding community.

Let’s start with the basics: Git commands. Think of Git commands like the different roles of the Friends characters. Just like how each character has a unique role in the group, each Git command has a unique function:

  1. git init — This is like Ross, the paleontologist. It initializes a new Git repository, just like how Ross is always digging up new fossils.
  2. git add — This is like Monica, the chef. It stages changes made to files, just like how Monica stages her ingredients before cooking a meal.
  3. git commit — This is like Chandler, the funny one. It commits changes to the repository, just like how Chandler always adds humor to the group.
  4. git push — This is like Rachel, the fashionista. It pushes changes to a remote repository, just like how Rachel is always pushing fashion boundaries.
  5. git pull — This is like Joey, the actor. It pulls changes from a remote repository, just like how Joey pulls in a big audience for his acting gigs.
  6. git clone — This is like Phoebe, the free spirit. It clones a repository from a remote location, just like how Phoebe’s eclectic personality is a blend of different experiences and perspectives.

Now, let’s talk about the benefits of using Git. Think of Git as the Central Perk coffee shop, where the Friends characters gather to share their lives and support each other. With Git, developers can collaborate and share their code with others, just like how the Friends characters share their stories and support each other through thick and thin.

Git also allows you to revert back to previous versions of your code, just like how the Friends characters reflect on their past experiences and learn from them. And, with Git, you can work on the same codebase simultaneously with others without worrying about conflicts or losing your changes. It’s like the perfect blend of the Friends group dynamic!

The next post will be regarding a few of the intermediate concepts like rebase, merge, blame, cherry-pick, etc. Let me know if you liked this article and any suggestions on how it could be improved.

--

--

Harinath R
Harinath R

Written by Harinath R

Software Developer | Full Stack Developer | Cricket lover | Bingewatcher

No responses yet