2 ms·
once you understand git's data model (objects, refs, log + reflog) -- it becomes very intuitive. git stores a snapshot of every commit along with the history (
by tonymet 1y ago
once you understand git's data model (objects, refs, log + reflog) -- it becomes very intuitive.
git stores a snapshot of every commit along with the history (the DAG / log) of where that snapshot came from.
Merges are just tree traversals from one branch to another.
Once you understand the data model, the clumsy commands become a bit more intuitive.
Get really confident with stash, reset, reflog & rebase . Those commands let you revert and reassemble the log easily.
nuking .git and starting fresh is why people struggle with git. All of the power is in the reflog and the ability to manipulate & restore a healthy state at any time.