# Git [[Source Control]] ## Snapshot based system Git is a snapshot-based system. A common misconception is that commits actually store some sort of "diff". But commits are just pointers to a directory state. Moving commits means that information is computed from the starting point (the commit), usually by diffing to some sort of parent, and then applying that to another directory state. Then creating a completely new commit (and tree). Michael Ciccotti brought up that git uses delta-compression to store the object blobs. More about [[Git Internals]]. I want to ask people a bunch of questions about git and see where people are at, so that I can write a follow up post [[BLOG IDEA - Follow Up To Git Squash Post]] - [[Questionnaire about git usage and understanding]] ## Git Internals Git uses the `diff3` [[Merge Algorithm]] for conflict resolution. ## Git Hooks Git hooks are something I don't know very much about. Tools like [[Husky]] and [[Lefthook]] however have come in handy, and I should leverage and learn them more. On the leadership slack, kunzmann posted about how [[Husky]] uses `core.hooksPath` to get the job done. ![[E450D7D5-A58F-48B7-AD48-862580BF5B21.jpeg]] [kunzmann on #programming about husky and git hookspath](https://rands-leadership.slack.com/archives/C0C2B4B8C/p1655603506062709?thread_ts=1655479345.608689&channel=C0C2B4B8C&message_ts=1655603506.062709) ## Blog articles I blogged about [[20220524 - Squash commits considered harmful]]. ## Links - [[BOOK - Building Git]] - [[BOOK - Git Internals]] - [A Git Origin Story | Linux Journal](https://www.linuxjournal.com/content/git-origin-story) A critical view of [[Git]] over at [[dev.to]]: - [Is Git Great? #healthydebate - DEV Community](https://dev.to/jmfayard/is-git-great-healthydebate-3l3l) ## Workflows - [gitmoji | An emoji guide for your commit messages](https://gitmoji.dev/) ## Tools - [GitHub - zielu/GitToolBox: GitToolBox IntelliJ plugin](https://github.com/zielu/GitToolBox/)