Git Help Desk

Object Database Layer 🎯

object database, $GIT_COMMON_DIR/objects/ (file system)
<pathspec>
$GIT_COMMON_DIR/(repository layout), repository format version

Managing Working Trees

.git directory gitdir: --git-dir/$GIT_DIR/automatically discovered
$GIT_WORK_TREE/**/.gitkeep
Precious Files Design Document
tracked
present (part of sparse checkout)
not present (not part of sparse checkout)
not tracked
ignored (expendable)
trashable (ignored-and-expendable)
precious (ignored-and-not-expendable)
untracked (not tracked and not ignored) (not expendable)

Source Code Management Layer 🎯

SCM
pseudoref
ref, $GIT_COMMON_DIR/refs/: name pointing to an object name/another ref, has refname and reflog
name pointing to another ref: symref (symbolic reference)
name pointing to an object name (git fetch):
branch's head, $GIT_COMMON_DIR/refs/heads/ (head ref): name pointing to tip of branch
tag, $GIT_COMMON_DIR/refs/tags/, <tag>
...
name pointing to either an object name/another ref:
HEAD, $GIT_DIR/HEAD, HEAD: name pointing to current branch or an arbitrary commit
detached HEAD (git checkout)
unborn branch: caused by git init or orphan operation
...

Repository Creation and Synchronization

repository: object database + refs + meta data
<repository>: URL or name of remote , tracks remote repository
<refspec> (git fetch) (git push)
git merge
git fetch
git pull
git push

Snapshotting

how to publish the tree from a commit without exposing its full history, how to start a disconnected history
git notes, $GIT_COMMON_DIR/refs/notes/, $GIT_DIR/{NOTES_MERGE_PARTIAL,NOTES_MERGE_WORKTREE,NOTES_MERGE_REF}
git replace, $GIT_COMMON_DIR/refs/replace/

Checkin/Checkout Filters

text/binary per file: text/eol/core.autocrlf
line-ending style per text file: eol/core.autocrlf/core.eol
ident
filter driver, clean filter, smudge filter, process filter: filter
diffcore transformation
DB
index
working
tree
checking whitespace errors per file: whitespace/core.whitespace

Diff Driver (for user facing diff output)

Diff Filter (mark up the diff further for human consumption)

Combining Diffs

1-way merge (single tree merge) (git read-tree) (trivial merge)
2-way merge (two tree merge) (git read-tree) (trivial merge)
3-way merge (git read-tree) (trivial merge)
non-fast-forward (update) (git push)
octopus (n-way merge)
topic branch
keep-canonical-history-correct
separating-topic-branches
git cherry

Merge Driver

merge driver per file: merge/merge.default
built-in merge drivers, how to define merge driver

Rewriting History

Miscellaneous

Examples