1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
|
<!DOCTYPE html>
<html>
<head>
<title>
The Codex »
Git Internals 101
</title>
<link
rel='stylesheet'
type='text/css'
href='http://fonts.googleapis.com/css?family=Buenard:400,700&subset=latin,latin-ext'>
<link
rel="stylesheet"
type="text/css"
href="../../media/css/reset.css">
<link
rel="stylesheet"
type="text/css"
href="../../media/css/grimoire.css">
</head>
<body>
<div id="shell">
<ol id="breadcrumbs">
<li class="crumb-0 not-last">
<a href="../../">index</a>
</li>
<li class="crumb-1 not-last">
<a href="../">git</a>
</li>
<li class="crumb-2 last">
theory-and-practice
</li>
</ol>
<div id="article">
<h1 id="git-internals-101">Git Internals 101</h1>
<p>Yeah, yeah, another article about “how Git works.” There are tons of these
already. Personally, I'm fond of Sitaram Chamarty's <a href="http://gitolite.com/master-toc.html">fantastic series of
articles</a> explaining Git from both ends,
and of <a href="http://eagain.net/articles/git-for-computer-scientists/">Git for Computer
Scientists</a>. Maybe
you'd rather read those.</p>
<p>This page was inspired by very specific, recurring issues I've run into while
helping people use Git. I think Git's “porcelain” layer -- its user interface
-- is terrible, and does a bad job of insulating non-expert users from Git's
internals. While I'd love to fix that (and I do contribute to discussions on
that front, too), we still have the <code>git(1)</code> UI right now and people still get
into trouble with it right now.</p>
<p>Git follows the New Jersey approach laid out in Richard Gabriel's <a href="http://www.dreamsongs.com/RiseOfWorseIsBetter.html">The Rise of
“Worse is Better”</a>: given
the choice between a simple implementation and a simple interface, Git chooses
the simple implementation almost everywhere. This internal simplicity can give
users the leverage to fix the problems that its horrible user interface leads
them into, so these pages will focus on explaining the simple parts and giving
users the tools to examine them.</p>
<p>Throughout these articles, I've written “Git does X” a lot. Git is
<em>incredibly</em> configurable; read that as “Git does X <em>by default</em>.” I'll try to
call out relevant configuration options as I go, where it doesn't interrupt
the flow of knowledge.</p>
<ul>
<li><a href="objects">Objects</a></li>
<li><a href="refs-and-names">Refs and Names</a></li>
</ul>
<p>By the way, if you think you're just going to follow the
<a href="http://git-scm.com/documentation">many</a>
<a href="http://www.atlassian.com/git/tutorial">excellent</a>
<a href="http://try.github.io/levels/1/challenges/1">git</a>
<a href="https://www.kernel.org/pub/software/scm/git/docs/gittutorial.html">tutorials</a>
out there and that you won't need this knowledge, well, you will. You can
either learn it during a quiet time, when you can think and experiment, or you
can learn it when something's gone wrong, and everyone's shouting at each
other. Git's high-level interface doesn't do much to keep you on the sensible
path, and you will eventually need to fix something.</p>
</div>
<div id="comments">
<div id="disqus_thread"></div>
<script type="text/javascript">
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
var disqus_shortname = 'grimoire'; // required: replace example with your forum shortname
/* * * DON'T EDIT BELOW THIS LINE * * */
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
<a href="http://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
</div>
<div id="footer">
<p>
The Codex —
Powered by <a href="http://markdoc.org/">Markdoc</a>.
<a href="https://bitbucket.org/ojacobson/grimoire.ca/src/master/wiki/git/theory-and-practice/index.md">See this page on Bitbucket</a> (<a href="https://bitbucket.org/ojacobson/grimoire.ca/history-node/master/wiki/git/theory-and-practice/index.md">history</a>).
</p>
</div>
</div>
</body>
</html>
|