Autogenerated HTML docs for v2.43.0-254-ga260
[git-htmldocs.git] / gitrepository-layout.html
blobc387997d7380c3712d6aca770384d9bf8a27b5f1
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
3 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
4 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
5 <head>
6 <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
7 <meta name="generator" content="AsciiDoc 10.2.0" />
8 <title>gitrepository-layout(5)</title>
9 <style type="text/css">
10 /* Shared CSS for AsciiDoc xhtml11 and html5 backends */
12 /* Default font. */
13 body {
14 font-family: Georgia,serif;
17 /* Title font. */
18 h1, h2, h3, h4, h5, h6,
19 div.title, caption.title,
20 thead, p.table.header,
21 #toctitle,
22 #author, #revnumber, #revdate, #revremark,
23 #footer {
24 font-family: Arial,Helvetica,sans-serif;
27 body {
28 margin: 1em 5% 1em 5%;
31 a {
32 color: blue;
33 text-decoration: underline;
35 a:visited {
36 color: fuchsia;
39 em {
40 font-style: italic;
41 color: navy;
44 strong {
45 font-weight: bold;
46 color: #083194;
49 h1, h2, h3, h4, h5, h6 {
50 color: #527bbd;
51 margin-top: 1.2em;
52 margin-bottom: 0.5em;
53 line-height: 1.3;
56 h1, h2, h3 {
57 border-bottom: 2px solid silver;
59 h2 {
60 padding-top: 0.5em;
62 h3 {
63 float: left;
65 h3 + * {
66 clear: left;
68 h5 {
69 font-size: 1.0em;
72 div.sectionbody {
73 margin-left: 0;
76 hr {
77 border: 1px solid silver;
80 p {
81 margin-top: 0.5em;
82 margin-bottom: 0.5em;
85 ul, ol, li > p {
86 margin-top: 0;
88 ul > li { color: #aaa; }
89 ul > li > * { color: black; }
91 .monospaced, code, pre {
92 font-family: "Courier New", Courier, monospace;
93 font-size: inherit;
94 color: navy;
95 padding: 0;
96 margin: 0;
98 pre {
99 white-space: pre-wrap;
102 #author {
103 color: #527bbd;
104 font-weight: bold;
105 font-size: 1.1em;
107 #email {
109 #revnumber, #revdate, #revremark {
112 #footer {
113 font-size: small;
114 border-top: 2px solid silver;
115 padding-top: 0.5em;
116 margin-top: 4.0em;
118 #footer-text {
119 float: left;
120 padding-bottom: 0.5em;
122 #footer-badges {
123 float: right;
124 padding-bottom: 0.5em;
127 #preamble {
128 margin-top: 1.5em;
129 margin-bottom: 1.5em;
131 div.imageblock, div.exampleblock, div.verseblock,
132 div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
133 div.admonitionblock {
134 margin-top: 1.0em;
135 margin-bottom: 1.5em;
137 div.admonitionblock {
138 margin-top: 2.0em;
139 margin-bottom: 2.0em;
140 margin-right: 10%;
141 color: #606060;
144 div.content { /* Block element content. */
145 padding: 0;
148 /* Block element titles. */
149 div.title, caption.title {
150 color: #527bbd;
151 font-weight: bold;
152 text-align: left;
153 margin-top: 1.0em;
154 margin-bottom: 0.5em;
156 div.title + * {
157 margin-top: 0;
160 td div.title:first-child {
161 margin-top: 0.0em;
163 div.content div.title:first-child {
164 margin-top: 0.0em;
166 div.content + div.title {
167 margin-top: 0.0em;
170 div.sidebarblock > div.content {
171 background: #ffffee;
172 border: 1px solid #dddddd;
173 border-left: 4px solid #f0f0f0;
174 padding: 0.5em;
177 div.listingblock > div.content {
178 border: 1px solid #dddddd;
179 border-left: 5px solid #f0f0f0;
180 background: #f8f8f8;
181 padding: 0.5em;
184 div.quoteblock, div.verseblock {
185 padding-left: 1.0em;
186 margin-left: 1.0em;
187 margin-right: 10%;
188 border-left: 5px solid #f0f0f0;
189 color: #888;
192 div.quoteblock > div.attribution {
193 padding-top: 0.5em;
194 text-align: right;
197 div.verseblock > pre.content {
198 font-family: inherit;
199 font-size: inherit;
201 div.verseblock > div.attribution {
202 padding-top: 0.75em;
203 text-align: left;
205 /* DEPRECATED: Pre version 8.2.7 verse style literal block. */
206 div.verseblock + div.attribution {
207 text-align: left;
210 div.admonitionblock .icon {
211 vertical-align: top;
212 font-size: 1.1em;
213 font-weight: bold;
214 text-decoration: underline;
215 color: #527bbd;
216 padding-right: 0.5em;
218 div.admonitionblock td.content {
219 padding-left: 0.5em;
220 border-left: 3px solid #dddddd;
223 div.exampleblock > div.content {
224 border-left: 3px solid #dddddd;
225 padding-left: 0.5em;
228 div.imageblock div.content { padding-left: 0; }
229 span.image img { border-style: none; vertical-align: text-bottom; }
230 a.image:visited { color: white; }
232 dl {
233 margin-top: 0.8em;
234 margin-bottom: 0.8em;
236 dt {
237 margin-top: 0.5em;
238 margin-bottom: 0;
239 font-style: normal;
240 color: navy;
242 dd > *:first-child {
243 margin-top: 0.1em;
246 ul, ol {
247 list-style-position: outside;
249 ol.arabic {
250 list-style-type: decimal;
252 ol.loweralpha {
253 list-style-type: lower-alpha;
255 ol.upperalpha {
256 list-style-type: upper-alpha;
258 ol.lowerroman {
259 list-style-type: lower-roman;
261 ol.upperroman {
262 list-style-type: upper-roman;
265 div.compact ul, div.compact ol,
266 div.compact p, div.compact p,
267 div.compact div, div.compact div {
268 margin-top: 0.1em;
269 margin-bottom: 0.1em;
272 tfoot {
273 font-weight: bold;
275 td > div.verse {
276 white-space: pre;
279 div.hdlist {
280 margin-top: 0.8em;
281 margin-bottom: 0.8em;
283 div.hdlist tr {
284 padding-bottom: 15px;
286 dt.hdlist1.strong, td.hdlist1.strong {
287 font-weight: bold;
289 td.hdlist1 {
290 vertical-align: top;
291 font-style: normal;
292 padding-right: 0.8em;
293 color: navy;
295 td.hdlist2 {
296 vertical-align: top;
298 div.hdlist.compact tr {
299 margin: 0;
300 padding-bottom: 0;
303 .comment {
304 background: yellow;
307 .footnote, .footnoteref {
308 font-size: 0.8em;
311 span.footnote, span.footnoteref {
312 vertical-align: super;
315 #footnotes {
316 margin: 20px 0 20px 0;
317 padding: 7px 0 0 0;
320 #footnotes div.footnote {
321 margin: 0 0 5px 0;
324 #footnotes hr {
325 border: none;
326 border-top: 1px solid silver;
327 height: 1px;
328 text-align: left;
329 margin-left: 0;
330 width: 20%;
331 min-width: 100px;
334 div.colist td {
335 padding-right: 0.5em;
336 padding-bottom: 0.3em;
337 vertical-align: top;
339 div.colist td img {
340 margin-top: 0.3em;
343 @media print {
344 #footer-badges { display: none; }
347 #toc {
348 margin-bottom: 2.5em;
351 #toctitle {
352 color: #527bbd;
353 font-size: 1.1em;
354 font-weight: bold;
355 margin-top: 1.0em;
356 margin-bottom: 0.1em;
359 div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
360 margin-top: 0;
361 margin-bottom: 0;
363 div.toclevel2 {
364 margin-left: 2em;
365 font-size: 0.9em;
367 div.toclevel3 {
368 margin-left: 4em;
369 font-size: 0.9em;
371 div.toclevel4 {
372 margin-left: 6em;
373 font-size: 0.9em;
376 span.aqua { color: aqua; }
377 span.black { color: black; }
378 span.blue { color: blue; }
379 span.fuchsia { color: fuchsia; }
380 span.gray { color: gray; }
381 span.green { color: green; }
382 span.lime { color: lime; }
383 span.maroon { color: maroon; }
384 span.navy { color: navy; }
385 span.olive { color: olive; }
386 span.purple { color: purple; }
387 span.red { color: red; }
388 span.silver { color: silver; }
389 span.teal { color: teal; }
390 span.white { color: white; }
391 span.yellow { color: yellow; }
393 span.aqua-background { background: aqua; }
394 span.black-background { background: black; }
395 span.blue-background { background: blue; }
396 span.fuchsia-background { background: fuchsia; }
397 span.gray-background { background: gray; }
398 span.green-background { background: green; }
399 span.lime-background { background: lime; }
400 span.maroon-background { background: maroon; }
401 span.navy-background { background: navy; }
402 span.olive-background { background: olive; }
403 span.purple-background { background: purple; }
404 span.red-background { background: red; }
405 span.silver-background { background: silver; }
406 span.teal-background { background: teal; }
407 span.white-background { background: white; }
408 span.yellow-background { background: yellow; }
410 span.big { font-size: 2em; }
411 span.small { font-size: 0.6em; }
413 span.underline { text-decoration: underline; }
414 span.overline { text-decoration: overline; }
415 span.line-through { text-decoration: line-through; }
417 div.unbreakable { page-break-inside: avoid; }
421 * xhtml11 specific
423 * */
425 div.tableblock {
426 margin-top: 1.0em;
427 margin-bottom: 1.5em;
429 div.tableblock > table {
430 border: 3px solid #527bbd;
432 thead, p.table.header {
433 font-weight: bold;
434 color: #527bbd;
436 p.table {
437 margin-top: 0;
439 /* Because the table frame attribute is overridden by CSS in most browsers. */
440 div.tableblock > table[frame="void"] {
441 border-style: none;
443 div.tableblock > table[frame="hsides"] {
444 border-left-style: none;
445 border-right-style: none;
447 div.tableblock > table[frame="vsides"] {
448 border-top-style: none;
449 border-bottom-style: none;
454 * html5 specific
456 * */
458 table.tableblock {
459 margin-top: 1.0em;
460 margin-bottom: 1.5em;
462 thead, p.tableblock.header {
463 font-weight: bold;
464 color: #527bbd;
466 p.tableblock {
467 margin-top: 0;
469 table.tableblock {
470 border-width: 3px;
471 border-spacing: 0px;
472 border-style: solid;
473 border-color: #527bbd;
474 border-collapse: collapse;
476 th.tableblock, td.tableblock {
477 border-width: 1px;
478 padding: 4px;
479 border-style: solid;
480 border-color: #527bbd;
483 table.tableblock.frame-topbot {
484 border-left-style: hidden;
485 border-right-style: hidden;
487 table.tableblock.frame-sides {
488 border-top-style: hidden;
489 border-bottom-style: hidden;
491 table.tableblock.frame-none {
492 border-style: hidden;
495 th.tableblock.halign-left, td.tableblock.halign-left {
496 text-align: left;
498 th.tableblock.halign-center, td.tableblock.halign-center {
499 text-align: center;
501 th.tableblock.halign-right, td.tableblock.halign-right {
502 text-align: right;
505 th.tableblock.valign-top, td.tableblock.valign-top {
506 vertical-align: top;
508 th.tableblock.valign-middle, td.tableblock.valign-middle {
509 vertical-align: middle;
511 th.tableblock.valign-bottom, td.tableblock.valign-bottom {
512 vertical-align: bottom;
517 * manpage specific
519 * */
521 body.manpage h1 {
522 padding-top: 0.5em;
523 padding-bottom: 0.5em;
524 border-top: 2px solid silver;
525 border-bottom: 2px solid silver;
527 body.manpage h2 {
528 border-style: none;
530 body.manpage div.sectionbody {
531 margin-left: 3em;
534 @media print {
535 body.manpage div#toc { display: none; }
539 </style>
540 <script type="text/javascript">
541 /*<![CDATA[*/
542 var asciidoc = { // Namespace.
544 /////////////////////////////////////////////////////////////////////
545 // Table Of Contents generator
546 /////////////////////////////////////////////////////////////////////
548 /* Author: Mihai Bazon, September 2002
549 * http://students.infoiasi.ro/~mishoo
551 * Table Of Content generator
552 * Version: 0.4
554 * Feel free to use this script under the terms of the GNU General Public
555 * License, as long as you do not remove or alter this notice.
558 /* modified by Troy D. Hanson, September 2006. License: GPL */
559 /* modified by Stuart Rackham, 2006, 2009. License: GPL */
561 // toclevels = 1..4.
562 toc: function (toclevels) {
564 function getText(el) {
565 var text = "";
566 for (var i = el.firstChild; i != null; i = i.nextSibling) {
567 if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
568 text += i.data;
569 else if (i.firstChild != null)
570 text += getText(i);
572 return text;
575 function TocEntry(el, text, toclevel) {
576 this.element = el;
577 this.text = text;
578 this.toclevel = toclevel;
581 function tocEntries(el, toclevels) {
582 var result = new Array;
583 var re = new RegExp('[hH]([1-'+(toclevels+1)+'])');
584 // Function that scans the DOM tree for header elements (the DOM2
585 // nodeIterator API would be a better technique but not supported by all
586 // browsers).
587 var iterate = function (el) {
588 for (var i = el.firstChild; i != null; i = i.nextSibling) {
589 if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
590 var mo = re.exec(i.tagName);
591 if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
592 result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
594 iterate(i);
598 iterate(el);
599 return result;
602 var toc = document.getElementById("toc");
603 if (!toc) {
604 return;
607 // Delete existing TOC entries in case we're reloading the TOC.
608 var tocEntriesToRemove = [];
609 var i;
610 for (i = 0; i < toc.childNodes.length; i++) {
611 var entry = toc.childNodes[i];
612 if (entry.nodeName.toLowerCase() == 'div'
613 && entry.getAttribute("class")
614 && entry.getAttribute("class").match(/^toclevel/))
615 tocEntriesToRemove.push(entry);
617 for (i = 0; i < tocEntriesToRemove.length; i++) {
618 toc.removeChild(tocEntriesToRemove[i]);
621 // Rebuild TOC entries.
622 var entries = tocEntries(document.getElementById("content"), toclevels);
623 for (var i = 0; i < entries.length; ++i) {
624 var entry = entries[i];
625 if (entry.element.id == "")
626 entry.element.id = "_toc_" + i;
627 var a = document.createElement("a");
628 a.href = "#" + entry.element.id;
629 a.appendChild(document.createTextNode(entry.text));
630 var div = document.createElement("div");
631 div.appendChild(a);
632 div.className = "toclevel" + entry.toclevel;
633 toc.appendChild(div);
635 if (entries.length == 0)
636 toc.parentNode.removeChild(toc);
640 /////////////////////////////////////////////////////////////////////
641 // Footnotes generator
642 /////////////////////////////////////////////////////////////////////
644 /* Based on footnote generation code from:
645 * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
648 footnotes: function () {
649 // Delete existing footnote entries in case we're reloading the footnodes.
650 var i;
651 var noteholder = document.getElementById("footnotes");
652 if (!noteholder) {
653 return;
655 var entriesToRemove = [];
656 for (i = 0; i < noteholder.childNodes.length; i++) {
657 var entry = noteholder.childNodes[i];
658 if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") == "footnote")
659 entriesToRemove.push(entry);
661 for (i = 0; i < entriesToRemove.length; i++) {
662 noteholder.removeChild(entriesToRemove[i]);
665 // Rebuild footnote entries.
666 var cont = document.getElementById("content");
667 var spans = cont.getElementsByTagName("span");
668 var refs = {};
669 var n = 0;
670 for (i=0; i<spans.length; i++) {
671 if (spans[i].className == "footnote") {
672 n++;
673 var note = spans[i].getAttribute("data-note");
674 if (!note) {
675 // Use [\s\S] in place of . so multi-line matches work.
676 // Because JavaScript has no s (dotall) regex flag.
677 note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
678 spans[i].innerHTML =
679 "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
680 "' title='View footnote' class='footnote'>" + n + "</a>]";
681 spans[i].setAttribute("data-note", note);
683 noteholder.innerHTML +=
684 "<div class='footnote' id='_footnote_" + n + "'>" +
685 "<a href='#_footnoteref_" + n + "' title='Return to text'>" +
686 n + "</a>. " + note + "</div>";
687 var id =spans[i].getAttribute("id");
688 if (id != null) refs["#"+id] = n;
691 if (n == 0)
692 noteholder.parentNode.removeChild(noteholder);
693 else {
694 // Process footnoterefs.
695 for (i=0; i<spans.length; i++) {
696 if (spans[i].className == "footnoteref") {
697 var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
698 href = href.match(/#.*/)[0]; // Because IE return full URL.
699 n = refs[href];
700 spans[i].innerHTML =
701 "[<a href='#_footnote_" + n +
702 "' title='View footnote' class='footnote'>" + n + "</a>]";
708 install: function(toclevels) {
709 var timerId;
711 function reinstall() {
712 asciidoc.footnotes();
713 if (toclevels) {
714 asciidoc.toc(toclevels);
718 function reinstallAndRemoveTimer() {
719 clearInterval(timerId);
720 reinstall();
723 timerId = setInterval(reinstall, 500);
724 if (document.addEventListener)
725 document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false);
726 else
727 window.onload = reinstallAndRemoveTimer;
731 asciidoc.install();
732 /*]]>*/
733 </script>
734 </head>
735 <body class="manpage">
736 <div id="header">
737 <h1>
738 gitrepository-layout(5) Manual Page
739 </h1>
740 <h2>NAME</h2>
741 <div class="sectionbody">
742 <p>gitrepository-layout -
743 Git Repository Layout
744 </p>
745 </div>
746 </div>
747 <div id="content">
748 <div class="sect1">
749 <h2 id="_synopsis">SYNOPSIS</h2>
750 <div class="sectionbody">
751 <div class="paragraph"><p>$GIT_DIR/*</p></div>
752 </div>
753 </div>
754 <div class="sect1">
755 <h2 id="_description">DESCRIPTION</h2>
756 <div class="sectionbody">
757 <div class="paragraph"><p>A Git repository comes in two different flavours:</p></div>
758 <div class="ulist"><ul>
759 <li>
761 a <code>.git</code> directory at the root of the working tree;
762 </p>
763 </li>
764 <li>
766 a <code>&lt;project&gt;.git</code> directory that is a <em>bare</em> repository
767 (i.e. without its own working tree), that is typically used for
768 exchanging histories with others by pushing into it and fetching
769 from it.
770 </p>
771 </li>
772 </ul></div>
773 <div class="paragraph"><p><strong>Note</strong>: Also you can have a plain text file <code>.git</code> at the root of
774 your working tree, containing <code>gitdir: &lt;path&gt;</code> to point at the real
775 directory that has the repository.
776 This mechanism is called a <em>gitfile</em> and is usually managed via the
777 <code>git submodule</code> and <code>git worktree</code> commands. It is often used for
778 a working tree of a submodule checkout, to allow you in the
779 containing superproject to <code>git checkout</code> a branch that does not
780 have the submodule. The <code>checkout</code> has to remove the entire
781 submodule working tree, without losing the submodule repository.</p></div>
782 <div class="paragraph"><p>These things may exist in a Git repository.</p></div>
783 <div class="dlist"><dl>
784 <dt class="hdlist1">
785 objects
786 </dt>
787 <dd>
789 Object store associated with this repository. Usually
790 an object store is self sufficient (i.e. all the objects
791 that are referred to by an object found in it are also
792 found in it), but there are a few ways to violate it.
793 </p>
794 <div class="olist arabic"><ol class="arabic">
795 <li>
797 You could have an incomplete but locally usable repository
798 by creating a shallow clone. See <a href="git-clone.html">git-clone(1)</a>.
799 </p>
800 </li>
801 <li>
803 You could be using the <code>objects/info/alternates</code> or
804 <code>$GIT_ALTERNATE_OBJECT_DIRECTORIES</code> mechanisms to <em>borrow</em>
805 objects from other object stores. A repository with this kind
806 of incomplete object store is not suitable to be published for
807 use with dumb transports but otherwise is OK as long as
808 <code>objects/info/alternates</code> points at the object stores it
809 borrows from.
810 </p>
811 <div class="paragraph"><p>This directory is ignored if $GIT_COMMON_DIR is set and
812 "$GIT_COMMON_DIR/objects" will be used instead.</p></div>
813 </li>
814 </ol></div>
815 </dd>
816 <dt class="hdlist1">
817 objects/[0-9a-f][0-9a-f]
818 </dt>
819 <dd>
821 A newly created object is stored in its own file.
822 The objects are splayed over 256 subdirectories using
823 the first two characters of the sha1 object name to
824 keep the number of directory entries in <code>objects</code>
825 itself to a manageable number. Objects found
826 here are often called <em>unpacked</em> (or <em>loose</em>) objects.
827 </p>
828 </dd>
829 <dt class="hdlist1">
830 objects/pack
831 </dt>
832 <dd>
834 Packs (files that store many objects in compressed form,
835 along with index files to allow them to be randomly
836 accessed) are found in this directory.
837 </p>
838 </dd>
839 <dt class="hdlist1">
840 objects/info
841 </dt>
842 <dd>
844 Additional information about the object store is
845 recorded in this directory.
846 </p>
847 </dd>
848 <dt class="hdlist1">
849 objects/info/packs
850 </dt>
851 <dd>
853 This file is to help dumb transports discover what packs
854 are available in this object store. Whenever a pack is
855 added or removed, <code>git update-server-info</code> should be run
856 to keep this file up to date if the repository is
857 published for dumb transports. <em>git repack</em> does this
858 by default.
859 </p>
860 </dd>
861 <dt class="hdlist1">
862 objects/info/alternates
863 </dt>
864 <dd>
866 This file records paths to alternate object stores that
867 this object store borrows objects from, one pathname per
868 line. Note that not only native Git tools use it locally,
869 but the HTTP fetcher also tries to use it remotely; this
870 will usually work if you have relative paths (relative
871 to the object database, not to the repository!) in your
872 alternates file, but it will not work if you use absolute
873 paths unless the absolute path in filesystem and web URL
874 is the same. See also <code>objects/info/http-alternates</code>.
875 </p>
876 </dd>
877 <dt class="hdlist1">
878 objects/info/http-alternates
879 </dt>
880 <dd>
882 This file records URLs to alternate object stores that
883 this object store borrows objects from, to be used when
884 the repository is fetched over HTTP.
885 </p>
886 </dd>
887 <dt class="hdlist1">
888 refs
889 </dt>
890 <dd>
892 References are stored in subdirectories of this
893 directory. The <em>git prune</em> command knows to preserve
894 objects reachable from refs found in this directory and
895 its subdirectories.
896 This directory is ignored (except refs/bisect,
897 refs/rewritten and refs/worktree) if $GIT_COMMON_DIR is
898 set and "$GIT_COMMON_DIR/refs" will be used instead.
899 </p>
900 </dd>
901 <dt class="hdlist1">
902 refs/heads/<code>name</code>
903 </dt>
904 <dd>
906 records tip-of-the-tree commit objects of branch <code>name</code>
907 </p>
908 </dd>
909 <dt class="hdlist1">
910 refs/tags/<code>name</code>
911 </dt>
912 <dd>
914 records any object name (not necessarily a commit
915 object, or a tag object that points at a commit object).
916 </p>
917 </dd>
918 <dt class="hdlist1">
919 refs/remotes/<code>name</code>
920 </dt>
921 <dd>
923 records tip-of-the-tree commit objects of branches copied
924 from a remote repository.
925 </p>
926 </dd>
927 <dt class="hdlist1">
928 refs/replace/<code>&lt;obj-sha1&gt;</code>
929 </dt>
930 <dd>
932 records the SHA-1 of the object that replaces <code>&lt;obj-sha1&gt;</code>.
933 This is similar to info/grafts and is internally used and
934 maintained by <a href="git-replace.html">git-replace(1)</a>. Such refs can be exchanged
935 between repositories while grafts are not.
936 </p>
937 </dd>
938 <dt class="hdlist1">
939 packed-refs
940 </dt>
941 <dd>
943 records the same information as refs/heads/, refs/tags/,
944 and friends record in a more efficient way. See
945 <a href="git-pack-refs.html">git-pack-refs(1)</a>. This file is ignored if $GIT_COMMON_DIR
946 is set and "$GIT_COMMON_DIR/packed-refs" will be used instead.
947 </p>
948 </dd>
949 <dt class="hdlist1">
950 HEAD
951 </dt>
952 <dd>
954 A symref (see glossary) to the <code>refs/heads/</code> namespace
955 describing the currently active branch. It does not mean
956 much if the repository is not associated with any working tree
957 (i.e. a <em>bare</em> repository), but a valid Git repository
958 <strong>must</strong> have the HEAD file; some porcelains may use it to
959 guess the designated "default" branch of the repository
960 (usually <em>master</em>). It is legal if the named branch
961 <em>name</em> does not (yet) exist. In some legacy setups, it is
962 a symbolic link instead of a symref that points at the current
963 branch.
964 </p>
965 <div class="paragraph"><p>HEAD can also record a specific commit directly, instead of
966 being a symref to point at the current branch. Such a state
967 is often called <em>detached HEAD.</em> See <a href="git-checkout.html">git-checkout(1)</a>
968 for details.</p></div>
969 </dd>
970 <dt class="hdlist1">
971 config
972 </dt>
973 <dd>
975 Repository specific configuration file. This file is ignored
976 if $GIT_COMMON_DIR is set and "$GIT_COMMON_DIR/config" will be
977 used instead.
978 </p>
979 </dd>
980 <dt class="hdlist1">
981 config.worktree
982 </dt>
983 <dd>
985 Working directory specific configuration file for the main
986 working directory in multiple working directory setup (see
987 <a href="git-worktree.html">git-worktree(1)</a>).
988 </p>
989 </dd>
990 <dt class="hdlist1">
991 branches
992 </dt>
993 <dd>
995 A slightly deprecated way to store shorthands to be used
996 to specify a URL to <em>git fetch</em>, <em>git pull</em> and <em>git push</em>.
997 A file can be stored as <code>branches/&lt;name&gt;</code> and then
998 <em>name</em> can be given to these commands in place of
999 <em>repository</em> argument. See the REMOTES section in
1000 <a href="git-fetch.html">git-fetch(1)</a> for details. This mechanism is legacy
1001 and not likely to be found in modern repositories. This
1002 directory is ignored if $GIT_COMMON_DIR is set and
1003 "$GIT_COMMON_DIR/branches" will be used instead.
1004 </p>
1005 </dd>
1006 <dt class="hdlist1">
1007 hooks
1008 </dt>
1009 <dd>
1011 Hooks are customization scripts used by various Git
1012 commands. A handful of sample hooks are installed when
1013 <em>git init</em> is run, but all of them are disabled by
1014 default. To enable, the <code>.sample</code> suffix has to be
1015 removed from the filename by renaming.
1016 Read <a href="githooks.html">githooks(5)</a> for more details about
1017 each hook. This directory is ignored if $GIT_COMMON_DIR is set
1018 and "$GIT_COMMON_DIR/hooks" will be used instead.
1019 </p>
1020 </dd>
1021 <dt class="hdlist1">
1022 common
1023 </dt>
1024 <dd>
1026 When multiple working trees are used, most of files in
1027 $GIT_DIR are per-worktree with a few known exceptions. All
1028 files under <em>common</em> however will be shared between all
1029 working trees.
1030 </p>
1031 </dd>
1032 <dt class="hdlist1">
1033 index
1034 </dt>
1035 <dd>
1037 The current index file for the repository. It is
1038 usually not found in a bare repository.
1039 </p>
1040 </dd>
1041 <dt class="hdlist1">
1042 sharedindex.&lt;SHA-1&gt;
1043 </dt>
1044 <dd>
1046 The shared index part, to be referenced by $GIT_DIR/index and
1047 other temporary index files. Only valid in split index mode.
1048 </p>
1049 </dd>
1050 <dt class="hdlist1">
1051 info
1052 </dt>
1053 <dd>
1055 Additional information about the repository is recorded
1056 in this directory. This directory is ignored if $GIT_COMMON_DIR
1057 is set and "$GIT_COMMON_DIR/info" will be used instead.
1058 </p>
1059 </dd>
1060 <dt class="hdlist1">
1061 info/refs
1062 </dt>
1063 <dd>
1065 This file helps dumb transports discover what refs are
1066 available in this repository. If the repository is
1067 published for dumb transports, this file should be
1068 regenerated by <em>git update-server-info</em> every time a tag
1069 or branch is created or modified. This is normally done
1070 from the <code>hooks/update</code> hook, which is run by the
1071 <em>git-receive-pack</em> command when you <em>git push</em> into the
1072 repository.
1073 </p>
1074 </dd>
1075 <dt class="hdlist1">
1076 info/grafts
1077 </dt>
1078 <dd>
1080 This file records fake commit ancestry information, to
1081 pretend the set of parents a commit has is different
1082 from how the commit was actually created. One record
1083 per line describes a commit and its fake parents by
1084 listing their 40-byte hexadecimal object names separated
1085 by a space and terminated by a newline.
1086 </p>
1087 <div class="paragraph"><p>Note that the grafts mechanism is outdated and can lead to problems
1088 transferring objects between repositories; see <a href="git-replace.html">git-replace(1)</a>
1089 for a more flexible and robust system to do the same thing.</p></div>
1090 </dd>
1091 <dt class="hdlist1">
1092 info/exclude
1093 </dt>
1094 <dd>
1096 This file, by convention among Porcelains, stores the
1097 exclude pattern list. <code>.gitignore</code> is the per-directory
1098 ignore file. <em>git status</em>, <em>git add</em>, <em>git rm</em> and
1099 <em>git clean</em> look at it but the core Git commands do not look
1100 at it. See also: <a href="gitignore.html">gitignore(5)</a>.
1101 </p>
1102 </dd>
1103 <dt class="hdlist1">
1104 info/attributes
1105 </dt>
1106 <dd>
1108 Defines which attributes to assign to a path, similar to per-directory
1109 <code>.gitattributes</code> files. See also: <a href="gitattributes.html">gitattributes(5)</a>.
1110 </p>
1111 </dd>
1112 <dt class="hdlist1">
1113 info/sparse-checkout
1114 </dt>
1115 <dd>
1117 This file stores sparse checkout patterns.
1118 See also: <a href="git-read-tree.html">git-read-tree(1)</a>.
1119 </p>
1120 </dd>
1121 <dt class="hdlist1">
1122 remotes
1123 </dt>
1124 <dd>
1126 Stores shorthands for URL and default refnames for use
1127 when interacting with remote repositories via <em>git fetch</em>,
1128 <em>git pull</em> and <em>git push</em> commands. See the REMOTES section
1129 in <a href="git-fetch.html">git-fetch(1)</a> for details. This mechanism is legacy
1130 and not likely to be found in modern repositories. This
1131 directory is ignored if $GIT_COMMON_DIR is set and
1132 "$GIT_COMMON_DIR/remotes" will be used instead.
1133 </p>
1134 </dd>
1135 <dt class="hdlist1">
1136 logs
1137 </dt>
1138 <dd>
1140 Records of changes made to refs are stored in this directory.
1141 See <a href="git-update-ref.html">git-update-ref(1)</a> for more information. This
1142 directory is ignored (except logs/HEAD) if $GIT_COMMON_DIR is
1143 set and "$GIT_COMMON_DIR/logs" will be used instead.
1144 </p>
1145 </dd>
1146 <dt class="hdlist1">
1147 logs/refs/heads/<code>name</code>
1148 </dt>
1149 <dd>
1151 Records all changes made to the branch tip named <code>name</code>.
1152 </p>
1153 </dd>
1154 <dt class="hdlist1">
1155 logs/refs/tags/<code>name</code>
1156 </dt>
1157 <dd>
1159 Records all changes made to the tag named <code>name</code>.
1160 </p>
1161 </dd>
1162 <dt class="hdlist1">
1163 shallow
1164 </dt>
1165 <dd>
1167 This is similar to <code>info/grafts</code> but is internally used
1168 and maintained by shallow clone mechanism. See <code>--depth</code>
1169 option to <a href="git-clone.html">git-clone(1)</a> and <a href="git-fetch.html">git-fetch(1)</a>. This
1170 file is ignored if $GIT_COMMON_DIR is set and
1171 "$GIT_COMMON_DIR/shallow" will be used instead.
1172 </p>
1173 </dd>
1174 <dt class="hdlist1">
1175 commondir
1176 </dt>
1177 <dd>
1179 If this file exists, $GIT_COMMON_DIR (see <a href="git.html">git(1)</a>) will
1180 be set to the path specified in this file if it is not
1181 explicitly set. If the specified path is relative, it is
1182 relative to $GIT_DIR. The repository with commondir is
1183 incomplete without the repository pointed by "commondir".
1184 </p>
1185 </dd>
1186 <dt class="hdlist1">
1187 modules
1188 </dt>
1189 <dd>
1191 Contains the git-repositories of the submodules.
1192 </p>
1193 </dd>
1194 <dt class="hdlist1">
1195 worktrees
1196 </dt>
1197 <dd>
1199 Contains administrative data for linked
1200 working trees. Each subdirectory contains the working tree-related
1201 part of a linked working tree. This directory is ignored if
1202 $GIT_COMMON_DIR is set, in which case
1203 "$GIT_COMMON_DIR/worktrees" will be used instead.
1204 </p>
1205 </dd>
1206 <dt class="hdlist1">
1207 worktrees/&lt;id&gt;/gitdir
1208 </dt>
1209 <dd>
1211 A text file containing the absolute path back to the .git file
1212 that points to here. This is used to check if the linked
1213 repository has been manually removed and there is no need to
1214 keep this directory any more. The mtime of this file should be
1215 updated every time the linked repository is accessed.
1216 </p>
1217 </dd>
1218 <dt class="hdlist1">
1219 worktrees/&lt;id&gt;/locked
1220 </dt>
1221 <dd>
1223 If this file exists, the linked working tree may be on a
1224 portable device and not available. The presence of this file
1225 prevents <code>worktrees/&lt;id&gt;</code> from being pruned either automatically
1226 or manually by <code>git worktree prune</code>. The file may contain a string
1227 explaining why the repository is locked.
1228 </p>
1229 </dd>
1230 <dt class="hdlist1">
1231 worktrees/&lt;id&gt;/config.worktree
1232 </dt>
1233 <dd>
1235 Working directory specific configuration file.
1236 </p>
1237 </dd>
1238 </dl></div>
1239 </div>
1240 </div>
1241 <div class="sect1">
1242 <h2 id="_git_repository_format_versions">Git Repository Format Versions</h2>
1243 <div class="sectionbody">
1244 <div class="paragraph"><p>Every git repository is marked with a numeric version in the
1245 <code>core.repositoryformatversion</code> key of its <code>config</code> file. This version
1246 specifies the rules for operating on the on-disk repository data. An
1247 implementation of git which does not understand a particular version
1248 advertised by an on-disk repository MUST NOT operate on that repository;
1249 doing so risks not only producing wrong results, but actually losing
1250 data.</p></div>
1251 <div class="paragraph"><p>Because of this rule, version bumps should be kept to an absolute
1252 minimum. Instead, we generally prefer these strategies:</p></div>
1253 <div class="ulist"><ul>
1254 <li>
1256 bumping format version numbers of individual data files (e.g.,
1257 index, packfiles, etc). This restricts the incompatibilities only to
1258 those files.
1259 </p>
1260 </li>
1261 <li>
1263 introducing new data that gracefully degrades when used by older
1264 clients (e.g., pack bitmap files are ignored by older clients, which
1265 simply do not take advantage of the optimization they provide).
1266 </p>
1267 </li>
1268 </ul></div>
1269 <div class="paragraph"><p>A whole-repository format version bump should only be part of a change
1270 that cannot be independently versioned. For instance, if one were to
1271 change the reachability rules for objects, or the rules for locking
1272 refs, that would require a bump of the repository format version.</p></div>
1273 <div class="paragraph"><p>Note that this applies only to accessing the repository&#8217;s disk contents
1274 directly. An older client which understands only format <code>0</code> may still
1275 connect via <code>git://</code> to a repository using format <code>1</code>, as long as the
1276 server process understands format <code>1</code>.</p></div>
1277 <div class="paragraph"><p>The preferred strategy for rolling out a version bump (whether whole
1278 repository or for a single file) is to teach git to read the new format,
1279 and allow writing the new format with a config switch or command line
1280 option (for experimentation or for those who do not care about backwards
1281 compatibility with older gits). Then after a long period to allow the
1282 reading capability to become common, we may switch to writing the new
1283 format by default.</p></div>
1284 <div class="paragraph"><p>The currently defined format versions are:</p></div>
1285 <div class="sect2">
1286 <h3 id="_version_code_0_code">Version <code>0</code></h3>
1287 <div class="paragraph"><p>This is the format defined by the initial version of git, including but
1288 not limited to the format of the repository directory, the repository
1289 configuration file, and the object and ref storage. Specifying the
1290 complete behavior of git is beyond the scope of this document.</p></div>
1291 </div>
1292 <div class="sect2">
1293 <h3 id="_version_code_1_code">Version <code>1</code></h3>
1294 <div class="paragraph"><p>This format is identical to version <code>0</code>, with the following exceptions:</p></div>
1295 <div class="olist arabic"><ol class="arabic">
1296 <li>
1298 When reading the <code>core.repositoryformatversion</code> variable, a git
1299 implementation which supports version 1 MUST also read any
1300 configuration keys found in the <code>extensions</code> section of the
1301 configuration file.
1302 </p>
1303 </li>
1304 <li>
1306 If a version-1 repository specifies any <code>extensions.*</code> keys that
1307 the running git has not implemented, the operation MUST NOT
1308 proceed. Similarly, if the value of any known key is not understood
1309 by the implementation, the operation MUST NOT proceed.
1310 </p>
1311 </li>
1312 </ol></div>
1313 <div class="paragraph"><p>Note that if no extensions are specified in the config file, then
1314 <code>core.repositoryformatversion</code> SHOULD be set to <code>0</code> (setting it to <code>1</code>
1315 provides no benefit, and makes the repository incompatible with older
1316 implementations of git).</p></div>
1317 <div class="paragraph"><p>This document will serve as the master list for extensions. Any
1318 implementation wishing to define a new extension should make a note of
1319 it here, in order to claim the name.</p></div>
1320 <div class="paragraph"><p>The defined extensions are:</p></div>
1321 <div class="sect3">
1322 <h4 id="_code_noop_code"><code>noop</code></h4>
1323 <div class="paragraph"><p>This extension does not change git&#8217;s behavior at all. It is useful only
1324 for testing format-1 compatibility.</p></div>
1325 </div>
1326 <div class="sect3">
1327 <h4 id="_code_preciousobjects_code"><code>preciousObjects</code></h4>
1328 <div class="paragraph"><p>When the config key <code>extensions.preciousObjects</code> is set to <code>true</code>,
1329 objects in the repository MUST NOT be deleted (e.g., by <code>git-prune</code> or
1330 <code>git repack -d</code>).</p></div>
1331 </div>
1332 <div class="sect3">
1333 <h4 id="_code_partialclone_code"><code>partialClone</code></h4>
1334 <div class="paragraph"><p>When the config key <code>extensions.partialClone</code> is set, it indicates
1335 that the repo was created with a partial clone (or later performed
1336 a partial fetch) and that the remote may have omitted sending
1337 certain unwanted objects. Such a remote is called a "promisor remote"
1338 and it promises that all such omitted objects can be fetched from it
1339 in the future.</p></div>
1340 <div class="paragraph"><p>The value of this key is the name of the promisor remote.</p></div>
1341 </div>
1342 <div class="sect3">
1343 <h4 id="_code_worktreeconfig_code"><code>worktreeConfig</code></h4>
1344 <div class="paragraph"><p>If set, by default "git config" reads from both "config" and
1345 "config.worktree" files from GIT_DIR in that order. In
1346 multiple working directory mode, "config" file is shared while
1347 "config.worktree" is per-working directory (i.e., it&#8217;s in
1348 GIT_COMMON_DIR/worktrees/&lt;id&gt;/config.worktree)</p></div>
1349 </div>
1350 </div>
1351 </div>
1352 </div>
1353 <div class="sect1">
1354 <h2 id="_see_also">SEE ALSO</h2>
1355 <div class="sectionbody">
1356 <div class="paragraph"><p><a href="git-init.html">git-init(1)</a>,
1357 <a href="git-clone.html">git-clone(1)</a>,
1358 <a href="git-fetch.html">git-fetch(1)</a>,
1359 <a href="git-pack-refs.html">git-pack-refs(1)</a>,
1360 <a href="git-gc.html">git-gc(1)</a>,
1361 <a href="git-checkout.html">git-checkout(1)</a>,
1362 <a href="gitglossary.html">gitglossary(7)</a>,
1363 <a href="user-manual.html">The Git User&#8217;s Manual</a></p></div>
1364 </div>
1365 </div>
1366 <div class="sect1">
1367 <h2 id="_git">GIT</h2>
1368 <div class="sectionbody">
1369 <div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
1370 </div>
1371 </div>
1372 </div>
1373 <div id="footnotes"><hr /></div>
1374 <div id="footer">
1375 <div id="footer-text">
1376 Last updated
1377 2023-12-20 13:32:13 PST
1378 </div>
1379 </div>
1380 </body>
1381 </html>