Published at
Updated at
Reading time
2min

Kyle Shevlin blogged about his belief in detailed atomic commits at work. On the contrary, he changes entire projects with a single commit in side projects. I feel you, Kyle.

To improve the side hustle commit chaos, Kyle added a make command called checkpoint to at least occasionally add progress to version control.

I have the same YOLO commit traits and, of course, I love this approach!

But I don't use make, so I created a more general solution as a custom Git command.

Quick tip: git- prefixed shell commands available in your $PATH will become git commands automatically.

A git-yolo shell file now defines my new git yolo command that's based on Kyle's original script.

#!/usr/bin/env sh

echo "🚀 You only live once, right?"
echo ""
git add -A
git commit -m "yoloing at $(date '+%Y-%m-%dT%H:%M')"
git push
echo ""
echo "⬆️  Yolo Checkpoint created and pushed to remote."

As a result, whenever I don't feel like (or don't care about) maintaining a clean Git history — git yolo will do the job.

$ git yolo
🚀 You only live once, right?

[main 23c80e0] yoloing at 2024-03-30T08:22
 1 file changed, 0 insertions(+), 0 deletions(-)
 delete mode 100644 fo
...
...

⬆️  Yolo Checkpoint created and pushed to remote

The Git history will then include some "yolo checkpoints" — at least.

$ git log 

commit 23c80e... (HEAD -> main, origin/main, origin/HEAD)
Author: stefan judis <stefanjudis@gmail.com>
Date:   Sat Mar 30 08:22:07 2024 +0100

    yoloing at 2024-03-30T08:22

commit 53yd07... (HEAD -> main, origin/main, origin/HEAD)
Author: stefan judis <stefanjudis@gmail.com>
Date:   Sat Mar 30 08:10:23 2024 +0100

    yoloing at 2024-03-30T08:10

Nice nice!

Was this snippet helpful?
Yes? Cool! You might want to check out Web Weekly for more snippets. The last edition went out 11 days ago.
Stefan standing in the park in front of a green background

About Stefan Judis

Frontend nerd with over ten years of experience, freelance dev, "Today I Learned" blogger, conference speaker, and Open Source maintainer.

Related Topics

Related Articles