{"id":3945,"date":"2022-12-20T17:28:29","date_gmt":"2022-12-20T20:28:29","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/giteveryday-man7\/"},"modified":"2022-12-20T17:28:29","modified_gmt":"2022-12-20T20:28:29","slug":"giteveryday-man7","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/giteveryday-man7\/","title":{"rendered":"GITEVERYDAY (man7)"},"content":{"rendered":"<h1 align=\"center\">GITEVERYDAY<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#INDIVIDUAL DEVELOPER (STANDALONE)\">INDIVIDUAL DEVELOPER (STANDALONE)<\/a><br \/> <a href=\"#INDIVIDUAL DEVELOPER (PARTICIPANT)\">INDIVIDUAL DEVELOPER (PARTICIPANT)<\/a><br \/> <a href=\"#INTEGRATOR\">INTEGRATOR<\/a><br \/> <a href=\"#REPOSITORY ADMINISTRATION\">REPOSITORY ADMINISTRATION<\/a><br \/> <a href=\"#GIT\">GIT<\/a><br \/> <a href=\"#NOTES\">NOTES<\/a> <\/p>\n<hr>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">giteveryday \u2212 A useful minimum set of commands for Everyday Git<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Everyday Git With 20 Commands Or So<\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Git users can broadly be grouped into four categories for the purposes of describing here a small set of useful command for everyday Git.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">\u2022 Individual Developer (Standalone) commands are essential for anybody who makes a commit, even for somebody who works alone.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">\u2022 If you work with other people, you will need commands listed in the Individual Developer (Participant) section as well.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">\u2022 People who play the Integrator role need to learn some more commands in addition to the above.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">\u2022 Repository Administration commands are for system administrators who are responsible for the care and feeding of Git repositories.<\/p>\n<h2>INDIVIDUAL DEVELOPER (STANDALONE) <a name=\"INDIVIDUAL DEVELOPER (STANDALONE)\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">A standalone individual developer does not exchange patches with other people, and works alone in a single repository, using the following commands.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">\u2022 <b>git-init<\/b>(1) to create a new repository.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">\u2022 <b>git-log<\/b>(1) to see what happened.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">\u2022 <b>git-switch<\/b>(1) and <b>git-branch<\/b>(1) to switch branches.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">\u2022 <b>git-add<\/b>(1) to manage the index file.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">\u2022 <b>git-diff<\/b>(1) and <b>git-status<\/b>(1) to see what you are in the middle of doing.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">\u2022 <b>git-commit<\/b>(1) to advance the current branch.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">\u2022 <b>git-restore<\/b>(1) to undo changes.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">\u2022 <b>git-merge<\/b>(1) to merge between local branches.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">\u2022 <b>git-rebase<\/b>(1) to maintain topic branches.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">\u2022 <b>git-tag<\/b>(1) to mark a known point.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Examples<\/b> <br \/> Use a tarball as a starting point for a new repository.<\/p>\n<p style=\"margin-left:23%; margin-top: 1em\">$ tar zxf frotz.tar.gz <br \/> $ cd frotz <br \/> $ git init <br \/> $ git add . <b>(1)<\/b> <br \/> $ git commit \u2212m &#8220;import of frotz source tree.&#8221; <br \/> $ git tag v2.43 <b>(2)<\/b><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><b>1.<\/b> add everything under the current directory. <b><br \/> 2.<\/b> make a lightweight, unannotated tag.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Create a topic branch and develop.<\/p>\n<p style=\"margin-left:23%; margin-top: 1em\">$ git switch \u2212c alsa\u2212audio <b>(1)<\/b> <br \/> $ edit\/compile\/test <br \/> $ git restore curses\/ux_audio_oss.c <b>(2)<\/b> <br \/> $ git add curses\/ux_audio_alsa.c <b>(3)<\/b> <br \/> $ edit\/compile\/test <br \/> $ git diff HEAD <b>(4)<\/b> <br \/> $ git commit \u2212a \u2212s <b>(5)<\/b> <br \/> $ edit\/compile\/test <br \/> $ git diff HEAD^ <b>(6)<\/b> <br \/> $ git commit \u2212a \u2212\u2212amend <b>(7)<\/b> <br \/> $ git switch master <b>(8)<\/b> <br \/> $ git merge alsa\u2212audio <b>(9)<\/b> <br \/> $ git log \u2212\u2212since=&#8217;3 days ago&#8217; <b>(10)<\/b> <br \/> $ git log v2.43.. curses\/ <b>(11)<\/b><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><b>1.<\/b> create a new topic branch. <b><br \/> 2.<\/b> revert your botched changes in <b>curses\/ux_audio_oss.c<\/b>. <b><br \/> 3.<\/b> you need to tell Git if you added a new file; removal and modification will be caught if you do <b>git commit \u2212a<\/b> later. <b><br \/> 4.<\/b> to see what changes you are committing. <b><br \/> 5.<\/b> commit everything, as you have tested, with your sign\u2212off. <b><br \/> 6.<\/b> look at all your changes including the previous commit. <b><br \/> 7.<\/b> amend the previous commit, adding all your new changes, using your original message. <b><br \/> 8.<\/b> switch to the master branch. <b><br \/> 9.<\/b> merge a topic branch into your master branch. <b><br \/> 10.<\/b> review commit logs; other forms to limit output can be combined and include <b>\u221210<\/b> (to show up to 10 commits), <b>\u2212\u2212until=2005\u221212\u221210<\/b>, etc. <b><br \/> 11.<\/b> view only the changes that touch what\u2019s in <b>curses\/<\/b> directory, since <b>v2.43<\/b> tag.<\/p>\n<h2>INDIVIDUAL DEVELOPER (PARTICIPANT) <a name=\"INDIVIDUAL DEVELOPER (PARTICIPANT)\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">A developer working as a participant in a group project needs to learn how to communicate with others, and uses these commands in addition to the ones needed by a standalone developer.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">\u2022 <b>git-clone<\/b>(1) from the upstream to prime your local repository.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">\u2022 <b>git-pull<\/b>(1) and <b>git-fetch<\/b>(1) from &#8220;origin&#8221; to keep up\u2212to\u2212date with the upstream.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">\u2022 <b>git-push<\/b>(1) to shared repository, if you adopt CVS style shared repository workflow.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">\u2022 <b>git-format-patch<\/b>(1) to prepare e\u2212mail submission, if you adopt Linux kernel\u2212style public forum workflow.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">\u2022 <b>git-send-email<\/b>(1) to send your e\u2212mail submission without corruption by your MUA.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">\u2022 <b>git-request-pull<\/b>(1) to create a summary of changes for your upstream to pull.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Examples<\/b> <br \/> Clone the upstream and work on it. Feed changes to upstream.<\/p>\n<p style=\"margin-left:23%; margin-top: 1em\">$ git clone git:\/\/git.kernel.org\/pub\/scm\/&#8230;\/torvalds\/linux\u22122.6 my2.6 <br \/> $ cd my2.6 <br \/> $ git switch \u2212c mine master <b>(1)<\/b> <br \/> $ edit\/compile\/test; git commit \u2212a \u2212s <b>(2)<\/b> <br \/> $ git format\u2212patch master <b>(3)<\/b> <br \/> $ git send\u2212email \u2212\u2212to=&#8221;person <email@example.com>&#8221; 00*.patch <b>(4)<\/b> <br \/> $ git switch master <b>(5)<\/b> <br \/> $ git pull <b>(6)<\/b> <br \/> $ git log \u2212p ORIG_HEAD.. arch\/i386 include\/asm\u2212i386 <b>(7)<\/b> <br \/> $ git ls\u2212remote \u2212\u2212heads http:\/\/git.kernel.org\/&#8230;\/jgarzik\/libata\u2212dev.git <b>(8)<\/b> <br \/> $ git pull git:\/\/git.kernel.org\/pub\/&#8230;\/jgarzik\/libata\u2212dev.git ALL <b>(9)<\/b> <br \/> $ git reset \u2212\u2212hard ORIG_HEAD <b>(10)<\/b> <br \/> $ git gc <b>(11)<\/b><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><b>1.<\/b> checkout a new branch <b>mine<\/b> from master. <b><br \/> 2.<\/b> repeat as needed. <b><br \/> 3.<\/b> extract patches from your branch, relative to master, <b><br \/> 4.<\/b> and email them. <b><br \/> 5.<\/b> return to <b>master<\/b>, ready to see what\u2019s new <b><br \/> 6. git pull<\/b> fetches from <b>origin<\/b> by default and merges into the current branch. <b><br \/> 7.<\/b> immediately after pulling, look at the changes done upstream since last time we checked, only in the area we are interested in. <b><br \/> 8.<\/b> check the branch names in an external repository (if not known). <b><br \/> 9.<\/b> fetch from a specific branch <b>ALL<\/b> from a specific repository and merge it. <b><br \/> 10.<\/b> revert the pull. <b><br \/> 11.<\/b> garbage collect leftover objects from reverted pull.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Push into another repository.<\/p>\n<p style=\"margin-left:23%; margin-top: 1em\">satellite$ git clone mothership:frotz frotz <b>(1)<\/b> <br \/> satellite$ cd frotz <br \/> satellite$ git config \u2212\u2212get\u2212regexp &#8216;^(remote|branch).&#8217; <b>(2)<\/b> <br \/> remote.origin.url mothership:frotz <br \/> remote.origin.fetch refs\/heads\/*:refs\/remotes\/origin\/* <br \/> branch.master.remote origin <br \/> branch.master.merge refs\/heads\/master <br \/> satellite$ git config remote.origin.push  <br \/> +refs\/heads\/*:refs\/remotes\/satellite\/* <b>(3)<\/b> <br \/> satellite$ edit\/compile\/test\/commit <br \/> satellite$ git push origin <b>(4)<\/b><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\">mothership$ cd frotz <br \/> mothership$ git switch master <br \/> mothership$ git merge satellite\/master <b>(5)<\/b><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><b>1.<\/b> mothership machine has a frotz repository under your home directory; clone from it to start a repository on the satellite machine. <b><br \/> 2.<\/b> clone sets these configuration variables by default. It arranges <b>git pull<\/b> to fetch and store the branches of mothership machine to local <b>remotes\/origin\/*<\/b> remote\u2212tracking branches. <b><br \/> 3.<\/b> arrange <b>git push<\/b> to push all local branches to their corresponding branch of the mothership machine. <b><br \/> 4.<\/b> push will stash all our work away on <b>remotes\/satellite\/*<\/b> remote\u2212tracking branches on the mothership machine. You could use this as a back\u2212up method. Likewise, you can pretend that mothership &#8220;fetched&#8221; from you (useful when access is one sided). <b><br \/> 5.<\/b> on mothership machine, merge the work done on the satellite machine into the master branch.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Branch off of a specific tag.<\/p>\n<p style=\"margin-left:23%; margin-top: 1em\">$ git switch \u2212c private2.6.14 v2.6.14 <b>(1)<\/b> <br \/> $ edit\/compile\/test; git commit \u2212a <br \/> $ git checkout master <br \/> $ git cherry\u2212pick v2.6.14..private2.6.14 <b>(2)<\/b><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><b>1.<\/b> create a private branch based on a well known (but somewhat behind) tag. <b><br \/> 2.<\/b> forward port all changes in <b>private2.6.14<\/b> branch to <b>master<\/b> branch without a formal &#8220;merging&#8221;. Or longhand<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><b>git format\u2212patch \u2212k \u2212m \u2212\u2212stdout v2.6.14..private2.6.14 | git am \u22123 \u2212k<\/b><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">An alternate participant submission mechanism is using the <b>git request\u2212pull<\/b> or pull\u2212request mechanisms (e.g as used on GitHub (www.github.com) to notify your upstream of your contribution.<\/p>\n<h2>INTEGRATOR <a name=\"INTEGRATOR\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">A fairly central person acting as the integrator in a group project receives changes made by others, reviews and integrates them and publishes the result for others to use, using these commands in addition to the ones needed by participants.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">This section can also be used by those who respond to <b>git request\u2212pull<\/b> or pull\u2212request on GitHub (www.github.com) to integrate the work of others into their history. A sub\u2212area lieutenant for a repository will act both as a participant and as an integrator.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">\u2022 <b>git-am<\/b>(1) to apply patches e\u2212mailed in from your contributors.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">\u2022 <b>git-pull<\/b>(1) to merge from your trusted lieutenants.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">\u2022 <b>git-format-patch<\/b>(1) to prepare and send suggested alternative to contributors.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">\u2022 <b>git-revert<\/b>(1) to undo botched commits.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">\u2022 <b>git-push<\/b>(1) to publish the bleeding edge.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Examples<\/b> <br \/> A typical integrator\u2019s Git day.<\/p>\n<p style=\"margin-left:23%; margin-top: 1em\">$ git status <b>(1)<\/b> <br \/> $ git branch \u2212\u2212no\u2212merged master <b>(2)<\/b> <br \/> $ mailx <b>(3)<\/b> <br \/> &#038; s 2 3 4 5 .\/+to\u2212apply <br \/> &#038; s 7 8 .\/+hold\u2212linus <br \/> &#038; q <br \/> $ git switch \u2212c topic\/one master <br \/> $ git am \u22123 \u2212i \u2212s .\/+to\u2212apply <b>(4)<\/b> <br \/> $ compile\/test <br \/> $ git switch \u2212c hold\/linus &#038;&#038; git am \u22123 \u2212i \u2212s .\/+hold\u2212linus <b>(5)<\/b> <br \/> $ git switch topic\/one &#038;&#038; git rebase master <b>(6)<\/b> <br \/> $ git switch \u2212C seen next <b>(7)<\/b> <br \/> $ git merge topic\/one topic\/two &#038;&#038; git merge hold\/linus <b>(8)<\/b> <br \/> $ git switch maint <br \/> $ git cherry\u2212pick master~4 <b>(9)<\/b> <br \/> $ compile\/test <br \/> $ git tag \u2212s \u2212m &#8220;GIT 0.99.9x&#8221; v0.99.9x <b>(10)<\/b> <br \/> $ git fetch ko &#038;&#038; for branch in master maint next seen <b>(11)<\/b> <br \/> do <br \/> git show\u2212branch ko\/$branch $branch <b>(12)<\/b> <br \/> done <br \/> $ git push \u2212\u2212follow\u2212tags ko <b>(13)<\/b><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><b>1.<\/b> see what you were in the middle of doing, if anything. <b><br \/> 2.<\/b> see which branches haven\u2019t been merged into <b>master<\/b> yet. Likewise for any other integration branches e.g. <b>maint<\/b>, <b>next<\/b> and <b>seen<\/b>. <b><br \/> 3.<\/b> read mails, save ones that are applicable, and save others that are not quite ready (other mail readers are available). <b><br \/> 4.<\/b> apply them, interactively, with your sign\u2212offs. <b><br \/> 5.<\/b> create topic branch as needed and apply, again with sign\u2212offs. <b><br \/> 6.<\/b> rebase internal topic branch that has not been merged to the master or exposed as a part of a stable branch. <b><br \/> 7.<\/b> restart <b>seen<\/b> every time from the next. <b><br \/> 8.<\/b> and bundle topic branches still cooking. <b><br \/> 9.<\/b> backport a critical fix. <b><br \/> 10.<\/b> create a signed tag. <b><br \/> 11.<\/b> make sure master was not accidentally rewound beyond that already pushed out. <b><br \/> 12.<\/b> In the output from <b>git show\u2212branch<\/b>, <b>master<\/b> should have everything <b>ko\/master<\/b> has, and <b>next<\/b> should have everything <b>ko\/next<\/b> has, etc. <b><br \/> 13.<\/b> push out the bleeding edge, together with new tags that point into the pushed history.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">In this example, the <b>ko<\/b> shorthand points at the Git maintainer\u2019s repository at kernel.org, and looks like this:<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">(in .git\/config) <br \/> [remote &#8220;ko&#8221;] <br \/> url = kernel.org:\/pub\/scm\/git\/git.git <br \/> fetch = refs\/heads\/*:refs\/remotes\/ko\/* <br \/> push = refs\/heads\/master <br \/> push = refs\/heads\/next <br \/> push = +refs\/heads\/seen <br \/> push = refs\/heads\/maint<\/p>\n<h2>REPOSITORY ADMINISTRATION <a name=\"REPOSITORY ADMINISTRATION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">A repository administrator uses the following tools to set up and maintain access to the repository by developers.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">\u2022 <b>git-daemon<\/b>(1) to allow anonymous download from repository.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">\u2022 <b>git-shell<\/b>(1) can be used as a <i>restricted login shell<\/i> for shared central repository users.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">\u2022 <b>git-http-backend<\/b>(1) provides a server side implementation of Git\u2212over\u2212HTTP (&#8220;Smart http&#8221;) allowing both fetch and push services.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">\u2022 <b>gitweb<\/b>(1) provides a web front\u2212end to Git repositories, which can be set\u2212up using the <b>git-instaweb<\/b>(1) script.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b><font color=\"#0000FF\">update hook howto<\/font><\/b> <small><font color=\"#000000\">[1]<\/font><\/small> <font color=\"#000000\">has a good example of managing a shared central repository.<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">In addition there are a number of other widely deployed hosting, browsing and reviewing solutions such as:<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\">\u2022 gitolite, gerrit code review, cgit and others.<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\"><b>Examples<\/b> <br \/> We assume the following in \/etc\/services<\/font><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><font color=\"#000000\">$ grep 9418 \/etc\/services <br \/> git 9418\/tcp # Git Version Control System<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">Run git\u2212daemon to serve \/pub\/scm from inetd.<\/font><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><font color=\"#000000\">$ grep git \/etc\/inetd.conf <br \/> git stream tcp nowait nobody  <br \/> \/usr\/bin\/git\u2212daemon git\u2212daemon \u2212\u2212inetd \u2212\u2212export\u2212all \/pub\/scm<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\">The actual configuration line should be on one line.<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">Run git\u2212daemon to serve \/pub\/scm from xinetd.<\/font><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><font color=\"#000000\">$ cat \/etc\/xinetd.d\/git\u2212daemon <br \/> # default: off <br \/> # description: The Git server offers access to Git repositories <br \/> service git <br \/> { <br \/> disable = no <br \/> type = UNLISTED <br \/> port = 9418 <br \/> socket_type = stream <br \/> wait = no <br \/> user = nobody <br \/> server = \/usr\/bin\/git\u2212daemon <br \/> server_args = \u2212\u2212inetd \u2212\u2212export\u2212all \u2212\u2212base\u2212path=\/pub\/scm <br \/> log_on_failure += USERID <br \/> }<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\">Check your xinetd(8) documentation and setup, this is from a Fedora system. Others might be different.<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">Give push\/pull only access to developers using git\u2212over\u2212ssh.<\/font><\/p>\n<p style=\"margin-left:17%;\"><font color=\"#000000\">e.g. those using: <b>$ git push\/pull ssh:\/\/host.xz\/pub\/scm\/project<\/b><\/font><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><font color=\"#000000\">$ grep git \/etc\/passwd <b>(1)<\/b> <br \/> alice:x:1000:1000::\/home\/alice:\/usr\/bin\/git\u2212shell <br \/> bob:x:1001:1001::\/home\/bob:\/usr\/bin\/git\u2212shell <br \/> cindy:x:1002:1002::\/home\/cindy:\/usr\/bin\/git\u2212shell <br \/> david:x:1003:1003::\/home\/david:\/usr\/bin\/git\u2212shell <br \/> $ grep git \/etc\/shells <b>(2)<\/b> <br \/> \/usr\/bin\/git\u2212shell<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\"><b>1.<\/b> log\u2212in shell is set to \/usr\/bin\/git\u2212shell, which does not allow anything but <b>git push<\/b> and <b>git pull<\/b>. The users require ssh access to the machine. <b><br \/> 2.<\/b> in many distributions \/etc\/shells needs to list what is used as the login shell.<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">CVS\u2212style shared repository.<\/font><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><font color=\"#000000\">$ grep git \/etc\/group <b>(1)<\/b> <br \/> git:x:9418:alice,bob,cindy,david <br \/> $ cd \/home\/devo.git <br \/> $ ls \u2212l <b>(2)<\/b> <br \/> lrwxrwxrwx 1 david git 17 Dec 4 22:40 HEAD \u2212> refs\/heads\/master <br \/> drwxrwsr\u2212x 2 david git 4096 Dec 4 22:40 branches <br \/> \u2212rw\u2212rw\u2212r\u2212\u2212 1 david git 84 Dec 4 22:40 config <br \/> \u2212rw\u2212rw\u2212r\u2212\u2212 1 david git 58 Dec 4 22:40 description <br \/> drwxrwsr\u2212x 2 david git 4096 Dec 4 22:40 hooks <br \/> \u2212rw\u2212rw\u2212r\u2212\u2212 1 david git 37504 Dec 4 22:40 index <br \/> drwxrwsr\u2212x 2 david git 4096 Dec 4 22:40 info <br \/> drwxrwsr\u2212x 4 david git 4096 Dec 4 22:40 objects <br \/> drwxrwsr\u2212x 4 david git 4096 Nov 7 14:58 refs <br \/> drwxrwsr\u2212x 2 david git 4096 Dec 4 22:40 remotes <br \/> $ ls \u2212l hooks\/update <b>(3)<\/b> <br \/> \u2212r\u2212xr\u2212xr\u2212x 1 david git 3536 Dec 4 22:40 update <br \/> $ cat info\/allowed\u2212users <b>(4)<\/b> <br \/> refs\/heads\/master alice|cindy <br \/> refs\/heads\/doc\u2212update bob <br \/> refs\/tags\/v[0\u22129]* david<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\"><b>1.<\/b> place the developers into the same git group. <b><br \/> 2.<\/b> and make the shared repository writable by the group. <b><br \/> 3.<\/b> use update\u2212hook example by Carl from Documentation\/howto\/ for branch policy control. <b><br \/> 4.<\/b> alice and cindy can push into master, only bob can push into doc\u2212update. david is the release manager and is the only person who can create and push version tags.<\/font><\/p>\n<h2>GIT <a name=\"GIT\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">Part of the <b>git<\/b>(1) suite<\/font><\/p>\n<h2>NOTES <a name=\"NOTES\"><\/a> <\/h2>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"12%\"><\/td>\n<td width=\"3%\">\n<p style=\"margin-top: 1em\"><font color=\"#000000\">1.<\/font><\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"26%\">\n<p style=\"margin-top: 1em\"><font color=\"#000000\">update hook howto<\/font><\/p>\n<\/td>\n<td width=\"57%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:17%;\"><font color=\"#000000\">file:\/\/\/usr\/share\/doc\/git-doc\/howto\/update-hook-example.html<\/font><\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  giteveryday \u2212 A useful minimum set of commands for Everyday Git <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[971],"tags":[973,1037,972],"class_list":["post-3945","post","type-post","status-publish","format-standard","hentry","category-7-miscelanea","tag-973","tag-giteveryday","tag-man7"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/3945","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=3945"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/3945\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=3945"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=3945"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=3945"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}