A Kitchen Tale

There is nothing like a lazy rainy Sunday evening. Curled up on my sofa with a book. I paused occasionally to catch a glimpse of the rain-drenched greenery outside my window. It was heaven. The only…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Git Commit or Wait to Git Wrecked

Commitment can be a scary, anxiety inducing idea for an overwhelming percentage of people. When we think about the concept of commitment in the context of life in general, we tend to associate it with permanence: committing to a career, committing to a house, relationship, car, Thanksgiving dinner… As if we no longer have any recourse as soon as we say “yes”. Though this fear is mostly imaginary, we nonetheless avoid and steer away from it, despite knowing they won’t just go away.

Commitments are an important and unavoidable part of life, but we are here to talk about a different kind of commitment — the git commit. And luckily for us, unlike in our daily lives, commits in the context of git carries quite the opposite implications, which is… Well, none.

If we think of the git workflow as an RPG video game(e.g. The Elder Scrolls V: Skyrim, Fallout), git commit can be thought of as the quick-save feature, which means it simply acts as a freebie checkpoint that allows us to revert our actions back in time with basically no negative consequences or repercussions. If this was a feature of life, I bet you top dollar that we’d all be using it every chance we get.

The inarguable best practice of git commit is to commit as early as possible, as often as possible, and as much as possible. Full stop. Given the lack of downsides, there is really no reason to resist and not commit.

Although for most of us, the problem is more so forgetfulness. It’s a simple problem really, and one that can be quickly trained and solidified if we just make a conscious effort to build up the habit through triggers: anytime we git init a new repo, commit immediately. Whenever you write a new function, commit. Anytime a new feature is added, definitely commit. About to try something you are not sure will work? Commit. Before you take your lunch break, commit. Getting up to pee? Commit. Hook up a car battery to your ears, set it on a timer to deliver a high voltage shock every 2 to 4 minutes to condition yourself to commit (and simultaneously make Ivan Pavlov real proud of you). Whatever works.

But above all, I think it helps to remember that while doing a git commit is quick and painless, losing hours, days, or weeks of work because you got overconfident and messed up real bad, is not. It has happened to me and every other developer out there, and it will happen to you.

Add a comment

Related posts:

Sameer Gaikwad CRUD Operations In ASP.NET MVC Using ADO.NET

Follow me Sameer Gaikwad then follow the link below! 👉 💯day challenge 📩 Reach out to me on Twitter or Linkedin, or Blogspot if you want to discuss this further. :) In this post, I’m going to…

15 Romantic Jokes to Make Your Sweetheart Smile

I definitely think so. And one of my favorite ways of trying to do that is by telling jokes. Clever jokes as often as I can find them, but even more often, my preferred jokes are rather cheesy. Some…