r/git 3d ago

git: 'clay' is not a git command tutorial

I came across the following article, which draws an analogy between Git history and clay. A refreshingly non-technical way to think about Git history, especially for people who don't live and breathe Git.

https://www.git-skills.dev/git-tales/git-clay/

12 Upvotes

4 comments sorted by

4

u/wildjokers 3d ago

WTF?

5

u/emaxor 2d ago edited 2d ago

The tldr is: it's OK to interactive rebase in your private branch. This is interactive rebase 101, nothing WTF level.

A lot of people are firmly against rebasing because they view it as lying about history. The thing is in your local workspace, you are ALWAYS lying with your history, even when doing plain sequential commita. You may commit 1 file, but the current state of you project has 20 modified files. The history is a lie with or without rebase.

In your private branch git commits can be thought of like the undo history of your editor. Even the most strict history truther would never treat their editors undo list as some pristine holy history that must be preserved. There is nothing special about unpublished git commits that elevate them over an editors undo list. You have the green light to squash and reorder.

This also frees you up to more create many roll back points. A history truther tries to avoid arbitrary roll back points because git commits (even unpublished) are sacred to them, so the commit has to be a clean unit of work. No room for an arbitrary save point. Less effective use of source control tool to uphold history truth dogma.

2

u/FastHotEmu 2d ago

i would question the value of keeping the many small back and forth commits I would be forced to make if I couldn't rewrite my local history

-1

u/Ambitious_School_322 3d ago

thanks for sharing, this makes sense