Timestamped Git yolo commits
- 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!
Join 5.4k readers and learn something new every week with Web Weekly.