3 ms·
> `git reflog`, which the article prominently mentions, really should be the VERY FIRST thing to teach everyone who is learning git. Top that up with `log` sho
by ezst 2y ago
> `git reflog`, which the article prominently mentions, really should be the VERY FIRST thing to teach everyone who is learning git.
Top that up with `log` showing all branches at all times (except if you ask otherwise) and you end up pretty much where mercurial is. Detached heads is such nonsense. Git missing phases and obsolescence (to denote if and how history eventually got rewritten) is another.
- anyfoo 2y agoOh, I actually make heavy uses of detached heads. The projects I work on frequently require you to look at a „snapshot“ of how the code was at a certain time when diagnosing issues, and it‘s good to be able to „look without touch“, i.e. being able to check out a specific state without it cluttering up my branches (though honestly, they‘re pretty cluttered already).
- ezst 2y agoYup, navigating history and checking-out commits at will is VCS ground-level. It's mind-blowing that git managed to make it unnecessarily complex by distinguishing "commits" from "commits with a label on them" (aka. branches), and putting in-your-face warnings when generating new commits in the former case (whereas the DAG itself doesn't care).
- anyfoo 2y agoI agree!