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">
6 <meta http-equiv=
"Content-Type" content=
"application/xhtml+xml; charset=UTF-8" />
7 <meta name=
"generator" content=
"AsciiDoc 10.2.0" />
8 <title>giteveryday(
7)
</title>
9 <style type=
"text/css">
10 /* Shared CSS for AsciiDoc xhtml11 and html5 backends */
14 font-family: Georgia,serif;
18 h1, h2, h3, h4, h5, h6,
19 div.title, caption.title,
20 thead, p.table.header,
22 #author, #revnumber, #revdate, #revremark,
24 font-family: Arial,Helvetica,sans-serif;
28 margin:
1em
5%
1em
5%;
33 text-decoration: underline;
49 h1, h2, h3, h4, h5, h6 {
57 border-bottom:
2px solid silver;
77 border:
1px solid silver;
88 ul
> li { color: #aaa; }
89 ul
> li
> * { color: black; }
91 .monospaced, code, pre {
92 font-family:
"Courier New", Courier, monospace;
99 white-space: pre-wrap;
109 #revnumber, #revdate, #revremark {
114 border-top:
2px solid silver;
120 padding-bottom:
0.5em;
124 padding-bottom:
0.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 {
135 margin-bottom:
1.5em;
137 div.admonitionblock {
139 margin-bottom:
2.0em;
144 div.content { /* Block element content. */
148 /* Block element titles. */
149 div.title, caption.title {
154 margin-bottom:
0.5em;
160 td div.title:first-child {
163 div.content div.title:first-child {
166 div.content + div.title {
170 div.sidebarblock
> div.content {
172 border:
1px solid #dddddd;
173 border-left:
4px solid #f0f0f0;
177 div.listingblock
> div.content {
178 border:
1px solid #dddddd;
179 border-left:
5px solid #f0f0f0;
184 div.quoteblock, div.verseblock {
188 border-left:
5px solid #f0f0f0;
192 div.quoteblock
> div.attribution {
197 div.verseblock
> pre.content {
198 font-family: inherit;
201 div.verseblock
> div.attribution {
205 /* DEPRECATED: Pre version
8.2.7 verse style literal block. */
206 div.verseblock + div.attribution {
210 div.admonitionblock .icon {
214 text-decoration: underline;
216 padding-right:
0.5em;
218 div.admonitionblock td.content {
220 border-left:
3px solid #dddddd;
223 div.exampleblock
> div.content {
224 border-left:
3px solid #dddddd;
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; }
234 margin-bottom:
0.8em;
247 list-style-position: outside;
250 list-style-type: decimal;
253 list-style-type: lower-alpha;
256 list-style-type: upper-alpha;
259 list-style-type: lower-roman;
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 {
269 margin-bottom:
0.1em;
281 margin-bottom:
0.8em;
284 padding-bottom:
15px;
286 dt.hdlist1.strong, td.hdlist1.strong {
292 padding-right:
0.8em;
298 div.hdlist.compact tr {
307 .footnote, .footnoteref {
311 span.footnote, span.footnoteref {
312 vertical-align: super;
316 margin:
20px
0 20px
0;
320 #footnotes div.footnote {
326 border-top:
1px solid silver;
335 padding-right:
0.5em;
336 padding-bottom:
0.3em;
344 #footer-badges { display: none; }
348 margin-bottom:
2.5em;
356 margin-bottom:
0.1em;
359 div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
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; }
427 margin-bottom:
1.5em;
429 div.tableblock
> table {
430 border:
3px solid #
527bbd;
432 thead, p.table.header {
439 /* Because the table frame attribute is overridden by CSS in most browsers. */
440 div.tableblock
> table[
frame=
"void"] {
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;
460 margin-bottom:
1.5em;
462 thead, p.tableblock.header {
473 border-color: #
527bbd;
474 border-collapse: collapse;
476 th.tableblock, td.tableblock {
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 {
498 th.tableblock.halign-center, td.tableblock.halign-center {
501 th.tableblock.halign-right, td.tableblock.halign-right {
505 th.tableblock.valign-top, td.tableblock.valign-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;
523 padding-bottom:
0.5em;
524 border-top:
2px solid silver;
525 border-bottom:
2px solid silver;
530 body.manpage div.sectionbody {
535 body.manpage div#toc { display: none; }
540 <script type=
"text/javascript">
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
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 */
562 toc: function (toclevels) {
564 function getText(el) {
566 for (var i = el.firstChild; i != null; i = i.nextSibling) {
567 if (i.nodeType ==
3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
569 else if (i.firstChild != null)
575 function TocEntry(el, text, toclevel) {
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
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);
602 var toc = document.getElementById(
"toc");
607 // Delete existing TOC entries in case we're reloading the TOC.
608 var tocEntriesToRemove = [];
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");
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.
651 var noteholder = document.getElementById(
"footnotes");
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");
670 for (i=
0; i
<spans.length; i++) {
671 if (spans[i].className ==
"footnote") {
673 var note = spans[i].getAttribute(
"data-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];
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;
692 noteholder.parentNode.removeChild(noteholder);
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.
701 "[<a href='#_footnote_" + n +
702 "' title='View footnote' class='footnote'>" + n +
"</a>]";
708 install: function(toclevels) {
711 function reinstall() {
712 asciidoc.footnotes();
714 asciidoc.toc(toclevels);
718 function reinstallAndRemoveTimer() {
719 clearInterval(timerId);
723 timerId = setInterval(reinstall,
500);
724 if (document.addEventListener)
725 document.addEventListener(
"DOMContentLoaded", reinstallAndRemoveTimer, false);
727 window.onload = reinstallAndRemoveTimer;
735 <body class=
"manpage">
738 giteveryday(
7) Manual Page
741 <div class=
"sectionbody">
743 A useful minimum set of commands for Everyday Git
749 <h2 id=
"_synopsis">SYNOPSIS
</h2>
750 <div class=
"sectionbody">
751 <div class=
"paragraph"><p>Everyday Git With
20 Commands Or So
</p></div>
755 <h2 id=
"_description">DESCRIPTION
</h2>
756 <div class=
"sectionbody">
757 <div class=
"paragraph"><p>Git users can broadly be grouped into four categories for the purposes of
758 describing here a small set of useful command for everyday Git.
</p></div>
759 <div class=
"ulist"><ul>
762 <a href=
"#STANDALONE">Individual Developer (Standalone)
</a> commands are essential
763 for anybody who makes a commit, even for somebody who works alone.
768 If you work with other people, you will need commands listed in
769 the
<a href=
"#PARTICIPANT">Individual Developer (Participant)
</a> section as well.
774 People who play the
<a href=
"#INTEGRATOR">Integrator
</a> role need to learn some
775 more commands in addition to the above.
780 <a href=
"#ADMINISTRATION">Repository Administration
</a> commands are for system
781 administrators who are responsible for the care and feeding
789 <h2 id=
"_individual_developer_standalone_a_id_standalone_a">Individual Developer (Standalone)
<a id=
"STANDALONE"></a></h2>
790 <div class=
"sectionbody">
791 <div class=
"paragraph"><p>A standalone individual developer does not exchange patches with
792 other people, and works alone in a single repository, using the
793 following commands.
</p></div>
794 <div class=
"ulist"><ul>
797 <a href=
"git-init.html">git-init(
1)
</a> to create a new repository.
802 <a href=
"git-log.html">git-log(
1)
</a> to see what happened.
807 <a href=
"git-switch.html">git-switch(
1)
</a> and
<a href=
"git-branch.html">git-branch(
1)
</a> to switch
813 <a href=
"git-add.html">git-add(
1)
</a> to manage the index file.
818 <a href=
"git-diff.html">git-diff(
1)
</a> and
<a href=
"git-status.html">git-status(
1)
</a> to see what
819 you are in the middle of doing.
824 <a href=
"git-commit.html">git-commit(
1)
</a> to advance the current branch.
829 <a href=
"git-restore.html">git-restore(
1)
</a> to undo changes.
834 <a href=
"git-merge.html">git-merge(
1)
</a> to merge between local branches.
839 <a href=
"git-rebase.html">git-rebase(
1)
</a> to maintain topic branches.
844 <a href=
"git-tag.html">git-tag(
1)
</a> to mark a known point.
849 <h3 id=
"_examples">Examples
</h3>
850 <div class=
"dlist"><dl>
852 Use a tarball as a starting point for a new repository.
855 <div class=
"listingblock">
856 <div class=
"content">
857 <pre><code>$ tar zxf frotz.tar.gz
860 $ git add .
<b><1></b>
861 $ git commit -m
"import of frotz source tree."
862 $ git tag v2.43
<b><2></b></code></pre>
864 <div class=
"colist arabic"><ol>
867 add everything under the current directory.
872 make a lightweight, unannotated tag.
878 Create a topic branch and develop.
881 <div class=
"listingblock">
882 <div class=
"content">
883 <pre><code>$ git switch -c alsa-audio
<b><1></b>
885 $ git restore curses/ux_audio_oss.c
<b><2></b>
886 $ git add curses/ux_audio_alsa.c
<b><3></b>
888 $ git diff HEAD
<b><4></b>
889 $ git commit -a -s
<b><5></b>
891 $ git diff HEAD^
<b><6></b>
892 $ git commit -a --amend
<b><7></b>
893 $ git switch master
<b><8></b>
894 $ git merge alsa-audio
<b><9></b>
895 $ git log --since='
3 days ago'
<b><10></b>
896 $ git log v2.43.. curses/
<b><11></b></code></pre>
898 <div class=
"colist arabic"><ol>
901 create a new topic branch.
906 revert your botched changes in
<code>curses/ux_audio_oss.c
</code>.
911 you need to tell Git if you added a new file; removal and
912 modification will be caught if you do
<code>git commit -a
</code> later.
917 to see what changes you are committing.
922 commit everything, as you have tested, with your sign-off.
927 look at all your changes including the previous commit.
932 amend the previous commit, adding all your new changes,
933 using your original message.
938 switch to the master branch.
943 merge a topic branch into your master branch.
948 review commit logs; other forms to limit output can be
949 combined and include
<code>-
10</code> (to show up to
10 commits),
950 <code>--until=
2005-
12-
10</code>, etc.
955 view only the changes that touch what
’s in
<code>curses/
</code>
956 directory, since
<code>v2.43
</code> tag.
966 <h2 id=
"_individual_developer_participant_a_id_participant_a">Individual Developer (Participant)
<a id=
"PARTICIPANT"></a></h2>
967 <div class=
"sectionbody">
968 <div class=
"paragraph"><p>A developer working as a participant in a group project needs to
969 learn how to communicate with others, and uses these commands in
970 addition to the ones needed by a standalone developer.
</p></div>
971 <div class=
"ulist"><ul>
974 <a href=
"git-clone.html">git-clone(
1)
</a> from the upstream to prime your local
980 <a href=
"git-pull.html">git-pull(
1)
</a> and
<a href=
"git-fetch.html">git-fetch(
1)
</a> from
"origin"
981 to keep up-to-date with the upstream.
986 <a href=
"git-push.html">git-push(
1)
</a> to shared repository, if you adopt CVS
987 style shared repository workflow.
992 <a href=
"git-format-patch.html">git-format-patch(
1)
</a> to prepare e-mail submission, if
993 you adopt Linux kernel-style public forum workflow.
998 <a href=
"git-send-email.html">git-send-email(
1)
</a> to send your e-mail submission without
999 corruption by your MUA.
1004 <a href=
"git-request-pull.html">git-request-pull(
1)
</a> to create a summary of changes
1005 for your upstream to pull.
1010 <h3 id=
"_examples_2">Examples
</h3>
1011 <div class=
"dlist"><dl>
1012 <dt class=
"hdlist1">
1013 Clone the upstream and work on it. Feed changes to upstream.
1016 <div class=
"listingblock">
1017 <div class=
"content">
1018 <pre><code>$ git clone git://git.kernel.org/pub/scm/.../torvalds/linux-
2.6 my2.6
1020 $ git switch -c mine master
<b><1></b>
1021 $ edit/compile/test; git commit -a -s
<b><2></b>
1022 $ git format-patch master
<b><3></b>
1023 $ git send-email
--to=
"person <email@example.com>" 00*.patch
<b><4></b>
1024 $ git switch master
<b><5></b>
1025 $ git pull
<b><6></b>
1026 $ git log -p ORIG_HEAD.. arch/i386 include/asm-i386
<b><7></b>
1027 $ git ls-remote --heads http://git.kernel.org/.../jgarzik/libata-dev.git
<b><8></b>
1028 $ git pull git://git.kernel.org/pub/.../jgarzik/libata-dev.git ALL
<b><9></b>
1029 $ git reset --hard ORIG_HEAD
<b><10></b>
1030 $ git gc
<b><11></b></code></pre>
1032 <div class=
"colist arabic"><ol>
1035 checkout a new branch
<code>mine
</code> from master.
1045 extract patches from your branch, relative to master,
1055 return to
<code>master
</code>, ready to see what
’s new
1060 <code>git pull
</code> fetches from
<code>origin
</code> by default and merges into the
1066 immediately after pulling, look at the changes done upstream
1067 since last time we checked, only in the
1068 area we are interested in.
1073 check the branch names in an external repository (if not known).
1078 fetch from a specific branch
<code>ALL
</code> from a specific repository
1089 garbage collect leftover objects from reverted pull.
1094 <dt class=
"hdlist1">
1095 Push into another repository.
1098 <div class=
"listingblock">
1099 <div class=
"content">
1100 <pre><code>satellite$ git clone mothership:frotz frotz
<b><1></b>
1102 satellite$ git config --get-regexp '^(remote|branch)\.'
<b><2></b>
1103 remote.origin.url mothership:frotz
1104 remote.origin.fetch refs/heads/*:refs/remotes/origin/*
1105 branch.master.remote origin
1106 branch.master.merge refs/heads/master
1107 satellite$ git config remote.origin.push \
1108 +refs/heads/*:refs/remotes/satellite/*
<b><3></b>
1109 satellite$ edit/compile/test/commit
1110 satellite$ git push origin
<b><4></b>
1112 mothership$ cd frotz
1113 mothership$ git switch master
1114 mothership$ git merge satellite/master
<b><5></b></code></pre>
1116 <div class=
"colist arabic"><ol>
1119 mothership machine has a frotz repository under your home
1120 directory; clone from it to start a repository on the satellite
1126 clone sets these configuration variables by default.
1127 It arranges
<code>git pull
</code> to fetch and store the branches of mothership
1128 machine to local
<code>remotes/origin/*
</code> remote-tracking branches.
1133 arrange
<code>git push
</code> to push all local branches to
1134 their corresponding branch of the mothership machine.
1139 push will stash all our work away on
<code>remotes/satellite/*
</code>
1140 remote-tracking branches on the mothership machine. You could use this
1141 as a back-up method. Likewise, you can pretend that mothership
1142 "fetched" from you (useful when access is one sided).
1147 on mothership machine, merge the work done on the satellite
1148 machine into the master branch.
1153 <dt class=
"hdlist1">
1154 Branch off of a specific tag.
1157 <div class=
"listingblock">
1158 <div class=
"content">
1159 <pre><code>$ git switch -c private2.6
.14 v2.6
.14 <b><1></b>
1160 $ edit/compile/test; git commit -a
1161 $ git checkout master
1162 $ git cherry-pick v2.6
.14..private2.6
.14 <b><2></b></code></pre>
1164 <div class=
"colist arabic"><ol>
1167 create a private branch based on a well known (but somewhat behind)
1173 forward port all changes in
<code>private2.6
.14</code> branch to
<code>master
</code> branch
1174 without a formal
"merging". Or longhand
<br />
1175 <code>git format-patch -k -m --stdout v2.6
.14..private2.6
.14 |
1182 <div class=
"paragraph"><p>An alternate participant submission mechanism is using the
1183 <code>git request-pull
</code> or pull-request mechanisms (e.g as used on
1184 GitHub (www.github.com) to notify your upstream of your
1185 contribution.
</p></div>
1190 <h2 id=
"_integrator_a_id_integrator_a">Integrator
<a id=
"INTEGRATOR"></a></h2>
1191 <div class=
"sectionbody">
1192 <div class=
"paragraph"><p>A fairly central person acting as the integrator in a group
1193 project receives changes made by others, reviews and integrates
1194 them and publishes the result for others to use, using these
1195 commands in addition to the ones needed by participants.
</p></div>
1196 <div class=
"paragraph"><p>This section can also be used by those who respond to
<code>git
1197 request-pull
</code> or pull-request on GitHub (www.github.com) to
1198 integrate the work of others into their history. A sub-area
1199 lieutenant for a repository will act both as a participant and
1200 as an integrator.
</p></div>
1201 <div class=
"ulist"><ul>
1204 <a href=
"git-am.html">git-am(
1)
</a> to apply patches e-mailed in from your
1210 <a href=
"git-pull.html">git-pull(
1)
</a> to merge from your trusted lieutenants.
1215 <a href=
"git-format-patch.html">git-format-patch(
1)
</a> to prepare and send suggested
1216 alternative to contributors.
1221 <a href=
"git-revert.html">git-revert(
1)
</a> to undo botched commits.
1226 <a href=
"git-push.html">git-push(
1)
</a> to publish the bleeding edge.
1231 <h3 id=
"_examples_3">Examples
</h3>
1232 <div class=
"dlist"><dl>
1233 <dt class=
"hdlist1">
1234 A typical integrator
’s Git day.
1237 <div class=
"listingblock">
1238 <div class=
"content">
1239 <pre><code>$ git status
<b><1></b>
1240 $ git branch --no-merged master
<b><2></b>
1241 $ mailx
<b><3></b>
1242 & s
2 3 4 5 ./+to-apply
1243 & s
7 8 ./+hold-linus
1245 $ git switch -c topic/one master
1246 $ git am -
3 -i -s ./+to-apply
<b><4></b>
1248 $ git switch -c hold/linus
&& git am -
3 -i -s ./+hold-linus
<b><5></b>
1249 $ git switch topic/one
&& git rebase master
<b><6></b>
1250 $ git switch -C seen next
<b><7></b>
1251 $ git merge topic/one topic/two
&& git merge hold/linus
<b><8></b>
1253 $ git cherry-pick master~
4 <b><9></b>
1255 $ git tag -s -m
"GIT 0.99.9x" v0.99
.9x
<b><10></b>
1256 $ git fetch ko
&& for branch in master maint next seen
<b><11></b>
1258 git show-branch ko/$branch $branch
<b><12></b>
1260 $ git push --follow-tags ko
<b><13></b></code></pre>
1262 <div class=
"colist arabic"><ol>
1265 see what you were in the middle of doing, if anything.
1270 see which branches haven
’t been merged into
<code>master
</code> yet.
1271 Likewise for any other integration branches e.g.
<code>maint
</code>,
<code>next
</code>
1272 and
<code>seen
</code>.
1277 read mails, save ones that are applicable, and save others
1278 that are not quite ready (other mail readers are available).
1283 apply them, interactively, with your sign-offs.
1288 create topic branch as needed and apply, again with sign-offs.
1293 rebase internal topic branch that has not been merged to the
1294 master or exposed as a part of a stable branch.
1299 restart
<code>seen
</code> every time from the next.
1304 and bundle topic branches still cooking.
1309 backport a critical fix.
1314 create a signed tag.
1319 make sure master was not accidentally rewound beyond that
1325 In the output from
<code>git show-branch
</code>,
<code>master
</code> should have
1326 everything
<code>ko/master
</code> has, and
<code>next
</code> should have
1327 everything
<code>ko/next
</code> has, etc.
1332 push out the bleeding edge, together with new tags that point
1333 into the pushed history.
1339 <div class=
"paragraph"><p>In this example, the
<code>ko
</code> shorthand points at the Git maintainer
’s
1340 repository at kernel.org, and looks like this:
</p></div>
1341 <div class=
"listingblock">
1342 <div class=
"content">
1343 <pre><code>(in .git/config)
1345 url = kernel.org:/pub/scm/git/git.git
1346 fetch = refs/heads/*:refs/remotes/ko/*
1347 push = refs/heads/master
1348 push = refs/heads/next
1349 push = +refs/heads/seen
1350 push = refs/heads/maint
</code></pre>
1356 <h2 id=
"_repository_administration_a_id_administration_a">Repository Administration
<a id=
"ADMINISTRATION"></a></h2>
1357 <div class=
"sectionbody">
1358 <div class=
"paragraph"><p>A repository administrator uses the following tools to set up
1359 and maintain access to the repository by developers.
</p></div>
1360 <div class=
"ulist"><ul>
1363 <a href=
"git-daemon.html">git-daemon(
1)
</a> to allow anonymous download from
1369 <a href=
"git-shell.html">git-shell(
1)
</a> can be used as a
<em>restricted login shell
</em>
1370 for shared central repository users.
1375 <a href=
"git-http-backend.html">git-http-backend(
1)
</a> provides a server side implementation
1376 of Git-over-HTTP (
"Smart http") allowing both fetch and push services.
1381 <a href=
"gitweb.html">gitweb(
1)
</a> provides a web front-end to Git repositories,
1382 which can be set-up using the
<a href=
"git-instaweb.html">git-instaweb(
1)
</a> script.
1386 <div class=
"paragraph"><p><a href=
"howto/update-hook-example.html">update hook howto
</a> has a good
1387 example of managing a shared central repository.
</p></div>
1388 <div class=
"paragraph"><p>In addition there are a number of other widely deployed hosting, browsing
1389 and reviewing solutions such as:
</p></div>
1390 <div class=
"ulist"><ul>
1393 gitolite, gerrit code review, cgit and others.
1398 <h3 id=
"_examples_4">Examples
</h3>
1399 <div class=
"dlist"><dl>
1400 <dt class=
"hdlist1">
1401 We assume the following in /etc/services
1404 <div class=
"listingblock">
1405 <div class=
"content">
1406 <pre><code>$ grep
9418 /etc/services
1407 git
9418/tcp # Git Version Control System
</code></pre>
1410 <dt class=
"hdlist1">
1411 Run git-daemon to serve /pub/scm from inetd.
1414 <div class=
"listingblock">
1415 <div class=
"content">
1416 <pre><code>$ grep git /etc/inetd.conf
1417 git stream tcp nowait nobody \
1418 /usr/bin/git-daemon git-daemon --inetd --export-all /pub/scm
</code></pre>
1420 <div class=
"paragraph"><p>The actual configuration line should be on one line.
</p></div>
1422 <dt class=
"hdlist1">
1423 Run git-daemon to serve /pub/scm from xinetd.
1426 <div class=
"listingblock">
1427 <div class=
"content">
1428 <pre><code>$ cat /etc/xinetd.d/git-daemon
1430 # description: The Git server offers access to Git repositories
1436 socket_type = stream
1439 server = /usr/bin/git-daemon
1440 server_args = --inetd --export-all --base-path=/pub/scm
1441 log_on_failure += USERID
1444 <div class=
"paragraph"><p>Check your xinetd(
8) documentation and setup, this is from a Fedora system.
1445 Others might be different.
</p></div>
1447 <dt class=
"hdlist1">
1448 Give push/pull only access to developers using git-over-ssh.
1453 <code>$ git push/pull ssh://host.xz/pub/scm/project
</code>
1455 <div class=
"listingblock">
1456 <div class=
"content">
1457 <pre><code>$ grep git /etc/passwd
<b><1></b>
1458 alice:x:
1000:
1000::/home/alice:/usr/bin/git-shell
1459 bob:x:
1001:
1001::/home/bob:/usr/bin/git-shell
1460 cindy:x:
1002:
1002::/home/cindy:/usr/bin/git-shell
1461 david:x:
1003:
1003::/home/david:/usr/bin/git-shell
1462 $ grep git /etc/shells
<b><2></b>
1463 /usr/bin/git-shell
</code></pre>
1465 <div class=
"colist arabic"><ol>
1468 log-in shell is set to /usr/bin/git-shell, which does not
1469 allow anything but
<code>git push
</code> and
<code>git pull
</code>. The users require
1470 ssh access to the machine.
1475 in many distributions /etc/shells needs to list what is used
1481 <dt class=
"hdlist1">
1482 CVS-style shared repository.
1485 <div class=
"listingblock">
1486 <div class=
"content">
1487 <pre><code>$ grep git /etc/group
<b><1></b>
1488 git:x:
9418:alice,bob,cindy,david
1490 $ ls -l
<b><2></b>
1491 lrwxrwxrwx
1 david git
17 Dec
4 22:
40 HEAD -
> refs/heads/master
1492 drwxrwsr-x
2 david git
4096 Dec
4 22:
40 branches
1493 -rw-rw-r--
1 david git
84 Dec
4 22:
40 config
1494 -rw-rw-r--
1 david git
58 Dec
4 22:
40 description
1495 drwxrwsr-x
2 david git
4096 Dec
4 22:
40 hooks
1496 -rw-rw-r--
1 david git
37504 Dec
4 22:
40 index
1497 drwxrwsr-x
2 david git
4096 Dec
4 22:
40 info
1498 drwxrwsr-x
4 david git
4096 Dec
4 22:
40 objects
1499 drwxrwsr-x
4 david git
4096 Nov
7 14:
58 refs
1500 drwxrwsr-x
2 david git
4096 Dec
4 22:
40 remotes
1501 $ ls -l hooks/update
<b><3></b>
1502 -r-xr-xr-x
1 david git
3536 Dec
4 22:
40 update
1503 $ cat info/allowed-users
<b><4></b>
1504 refs/heads/master alice\|cindy
1505 refs/heads/doc-update bob
1506 refs/tags/v[
0-
9]* david
</code></pre>
1508 <div class=
"colist arabic"><ol>
1511 place the developers into the same git group.
1516 and make the shared repository writable by the group.
1521 use update-hook example by Carl from Documentation/howto/
1522 for branch policy control.
1527 alice and cindy can push into master, only bob can push into doc-update.
1528 david is the release manager and is the only person who can
1529 create and push version tags.
1539 <h2 id=
"_git">GIT
</h2>
1540 <div class=
"sectionbody">
1541 <div class=
"paragraph"><p>Part of the
<a href=
"git.html">git(
1)
</a> suite
</p></div>
1545 <div id=
"footnotes"><hr /></div>
1547 <div id=
"footer-text">
1549 2020-
07-
09 15:
39:
10 PDT