
Fun with Git
a tribute to my most used UNIX command
I’ve always wanted to write. I’ve always wanted to tell a story.
Didn’t happen though, at least not yet. That’s not for the lack of trying. I’ve tried but I’m just,
- Too technical. Technicalities over imagination.
- I get overwhelmed by too many words. #somuchwords
- Words get overwhelmed with me too.

And then one day, I learned how to code.
And I realized that as I code, I also write. I am a writer. An author. Code repos are my books. Collaborators are my readers.
What does it have to do with git? Git makes collaboration easy.

Let’s have a git refresher today.
History of git
It started with a penguin, the Linux kernel.

From 1991 to 2002, the Linux kernel team passed around code changes as patches and archived files. In 2002, they started using a DVCS called BitKeeper.

Unfortunately after 3 years, the penguin’s heart got broken.

In 2005, BitKeeper became a paid tool and Linus Torvalds started creating git with all the learnings from using BitKeeper.

The penguin found its forever. 💖
The 5 main goals of git
- Speed
- Simple
- Can support multiple parallel branches
- FREE
- Can support the Linux kernel code
Why was it named git? According to Wikipedia, it was named by Linus Torvalds. He described it’s 2 aspects separately. He described the tool as ‘the stupid content tracker’, and he described the names as (depending on your mood),
a. (when you’re feeling random and lazy) - a random 3-letter combination that is easily pronounceable and not a UNIX command yet.
b. (when you’re feeling witty) - stupid, simple, contemptible and despicable. Take your pick from the dictionary of slang.
c. (when you’re feeling smart, in a good mood, everything just works and the light suddenly fills the room) - ‘global information tracker’
d. (when everything is breaking right in front of you) - ‘goddamn idiotic truckload’
How git works?
Let’s start with a local working directory

When we initialize a local directory to use git by doing a ‘git init’, a folder named ‘.git’ will be created. It is now ready to be distributed. Also, it will be divided into 3 parts

- the working directory
- the staging area
- local repo
In addition, the items inside that local working directory can undergo 3 states
- unmodified (default)
- modified (changed)
- staged (through ‘git add’)

Those staged changes are now ready to be moved to the local repo by doing a ‘git commit’ and to the remote repo by doing ‘git push’
Once the remote repo is updated, collaborators may do a ‘git pull’ to get those changes.
Git Tips
A collection of tips can be found here but I will cite few of my favorites
- gitk
- git help everyday
- git commit — amend
- git commit — amend — author
- git whatchanged — since=’2 weeks ago’
- git fetch, git rebase
- git bisect
Thanks Mr. Torvalds for git.
That is all. Remember to always have fun and create.
Resources: