{
    "content": [
        {
            "type": "text",
            "text": "# GITEVERYDAY (man)\n\n## NAME\n\ngiteveryday - A useful minimum set of commands for Everyday Git\n\n## SYNOPSIS\n\nEveryday Git With 20 Commands Or So\n\n## DESCRIPTION\n\nGit users can broadly be grouped into four categories for the purposes of describing here a\nsmall set of useful command for everyday Git.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION** (4 subsections)\n- **INTEGRATOR** (1 subsections)\n- **REPOSITORY ADMINISTRATION** (1 subsections)\n- **GIT**\n- **NOTES**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "GITEVERYDAY",
        "section": "",
        "mode": "man",
        "summary": "giteveryday - A useful minimum set of commands for Everyday Git",
        "synopsis": "Everyday Git With 20 Commands Or So",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 15,
                "subsections": [
                    {
                        "name": "INDIVIDUAL DEVELOPER (STANDALONE)",
                        "lines": 23
                    },
                    {
                        "name": "Examples",
                        "lines": 43
                    },
                    {
                        "name": "INDIVIDUAL DEVELOPER (PARTICIPANT)",
                        "lines": 17
                    },
                    {
                        "name": "Examples",
                        "lines": 77
                    }
                ]
            },
            {
                "name": "INTEGRATOR",
                "lines": 18,
                "subsections": [
                    {
                        "name": "Examples",
                        "lines": 57
                    }
                ]
            },
            {
                "name": "REPOSITORY ADMINISTRATION",
                "lines": 20,
                "subsections": [
                    {
                        "name": "Examples",
                        "lines": 79
                    }
                ]
            },
            {
                "name": "GIT",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "NOTES",
                "lines": 6,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "giteveryday - A useful minimum set of commands for Everyday Git\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "Everyday Git With 20 Commands Or So\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "Git users can broadly be grouped into four categories for the purposes of describing here a\nsmall set of useful command for everyday Git.\n\n•   Individual Developer (Standalone) commands are essential for anybody who makes a commit,\neven for somebody who works alone.\n\n•   If you work with other people, you will need commands listed in the Individual Developer\n(Participant) section as well.\n\n•   People who play the Integrator role need to learn some more commands in addition to the\nabove.\n\n•   Repository Administration commands are for system administrators who are responsible for\nthe care and feeding of Git repositories.\n",
                "subsections": [
                    {
                        "name": "INDIVIDUAL DEVELOPER (STANDALONE)",
                        "content": "A standalone individual developer does not exchange patches with other people, and works\nalone in a single repository, using the following commands.\n\n•   git-init(1) to create a new repository.\n\n•   git-log(1) to see what happened.\n\n•   git-switch(1) and git-branch(1) to switch branches.\n\n•   git-add(1) to manage the index file.\n\n•   git-diff(1) and git-status(1) to see what you are in the middle of doing.\n\n•   git-commit(1) to advance the current branch.\n\n•   git-restore(1) to undo changes.\n\n•   git-merge(1) to merge between local branches.\n\n•   git-rebase(1) to maintain topic branches.\n\n•   git-tag(1) to mark a known point.\n"
                    },
                    {
                        "name": "Examples",
                        "content": "Use a tarball as a starting point for a new repository.\n\n$ tar zxf frotz.tar.gz\n$ cd frotz\n$ git init\n$ git add . (1)\n$ git commit -m \"import of frotz source tree.\"\n$ git tag v2.43 (2)\n\n1. add everything under the current directory.\n2. make a lightweight, unannotated tag.\n\nCreate a topic branch and develop.\n\n$ git switch -c alsa-audio (1)\n$ edit/compile/test\n$ git restore curses/uxaudiooss.c (2)\n$ git add curses/uxaudioalsa.c (3)\n$ edit/compile/test\n$ git diff HEAD (4)\n$ git commit -a -s (5)\n$ edit/compile/test\n$ git diff HEAD^ (6)\n$ git commit -a --amend (7)\n$ git switch master (8)\n$ git merge alsa-audio (9)\n$ git log --since='3 days ago' (10)\n$ git log v2.43.. curses/ (11)\n\n1. create a new topic branch.\n2. revert your botched changes in curses/uxaudiooss.c.\n3. you need to tell Git if you added a new file; removal and modification will be caught\nif you do git commit -a later.\n4. to see what changes you are committing.\n5. commit everything, as you have tested, with your sign-off.\n6. look at all your changes including the previous commit.\n7. amend the previous commit, adding all your new changes, using your original message.\n8. switch to the master branch.\n9. merge a topic branch into your master branch.\n10. review commit logs; other forms to limit output can be combined and include -10 (to\nshow up to 10 commits), --until=2005-12-10, etc.\n11. view only the changes that touch what’s in curses/ directory, since v2.43 tag.\n"
                    },
                    {
                        "name": "INDIVIDUAL DEVELOPER (PARTICIPANT)",
                        "content": "A developer working as a participant in a group project needs to learn how to communicate\nwith others, and uses these commands in addition to the ones needed by a standalone\ndeveloper.\n\n•   git-clone(1) from the upstream to prime your local repository.\n\n•   git-pull(1) and git-fetch(1) from \"origin\" to keep up-to-date with the upstream.\n\n•   git-push(1) to shared repository, if you adopt CVS style shared repository workflow.\n\n•   git-format-patch(1) to prepare e-mail submission, if you adopt Linux kernel-style public\nforum workflow.\n\n•   git-send-email(1) to send your e-mail submission without corruption by your MUA.\n\n•   git-request-pull(1) to create a summary of changes for your upstream to pull.\n"
                    },
                    {
                        "name": "Examples",
                        "content": "Clone the upstream and work on it. Feed changes to upstream.\n\n$ git clone git://git.kernel.org/pub/scm/.../torvalds/linux-2.6 my2.6\n$ cd my2.6\n$ git switch -c mine master (1)\n$ edit/compile/test; git commit -a -s (2)\n$ git format-patch master (3)\n$ git send-email --to=\"person <email@example.com>\" 00*.patch (4)\n$ git switch master (5)\n$ git pull (6)\n$ git log -p ORIGHEAD.. arch/i386 include/asm-i386 (7)\n$ git ls-remote --heads http://git.kernel.org/.../jgarzik/libata-dev.git (8)\n$ git pull git://git.kernel.org/pub/.../jgarzik/libata-dev.git ALL (9)\n$ git reset --hard ORIGHEAD (10)\n$ git gc (11)\n\n1. checkout a new branch mine from master.\n2. repeat as needed.\n3. extract patches from your branch, relative to master,\n4. and email them.\n5. return to master, ready to see what’s new\n6. git pull fetches from origin by default and merges into the current branch.\n7. immediately after pulling, look at the changes done upstream since last time we\nchecked, only in the area we are interested in.\n8. check the branch names in an external repository (if not known).\n9. fetch from a specific branch ALL from a specific repository and merge it.\n10. revert the pull.\n11. garbage collect leftover objects from reverted pull.\n\nPush into another repository.\n\nsatellite$ git clone mothership:frotz frotz (1)\nsatellite$ cd frotz\nsatellite$ git config --get-regexp '^(remote|branch)\\.' (2)\nremote.origin.url mothership:frotz\nremote.origin.fetch refs/heads/*:refs/remotes/origin/*\nbranch.master.remote origin\nbranch.master.merge refs/heads/master\nsatellite$ git config remote.origin.push \\\n+refs/heads/*:refs/remotes/satellite/* (3)\nsatellite$ edit/compile/test/commit\nsatellite$ git push origin (4)\n\nmothership$ cd frotz\nmothership$ git switch master\nmothership$ git merge satellite/master (5)\n\n1. mothership machine has a frotz repository under your home directory; clone from it to\nstart a repository on the satellite machine.\n2. clone sets these configuration variables by default. It arranges git pull to fetch and\nstore the branches of mothership machine to local remotes/origin/* remote-tracking\nbranches.\n3. arrange git push to push all local branches to their corresponding branch of the\nmothership machine.\n4. push will stash all our work away on remotes/satellite/* remote-tracking branches on\nthe mothership machine. You could use this as a back-up method. Likewise, you can pretend\nthat mothership \"fetched\" from you (useful when access is one sided).\n5. on mothership machine, merge the work done on the satellite machine into the master\nbranch.\n\nBranch off of a specific tag.\n\n$ git switch -c private2.6.14 v2.6.14 (1)\n$ edit/compile/test; git commit -a\n$ git checkout master\n$ git cherry-pick v2.6.14..private2.6.14 (2)\n\n1. create a private branch based on a well known (but somewhat behind) tag.\n2. forward port all changes in private2.6.14 branch to master branch without a formal\n\"merging\". Or longhand\n\ngit format-patch -k -m --stdout v2.6.14..private2.6.14 | git am -3 -k\n\nAn alternate participant submission mechanism is using the git request-pull or pull-request\nmechanisms (e.g as used on GitHub (www.github.com) to notify your upstream of your\ncontribution.\n"
                    }
                ]
            },
            "INTEGRATOR": {
                "content": "A fairly central person acting as the integrator in a group project receives changes made by\nothers, reviews and integrates them and publishes the result for others to use, using these\ncommands in addition to the ones needed by participants.\n\nThis section can also be used by those who respond to git request-pull or pull-request on\nGitHub (www.github.com) to integrate the work of others into their history. A sub-area\nlieutenant for a repository will act both as a participant and as an integrator.\n\n•   git-am(1) to apply patches e-mailed in from your contributors.\n\n•   git-pull(1) to merge from your trusted lieutenants.\n\n•   git-format-patch(1) to prepare and send suggested alternative to contributors.\n\n•   git-revert(1) to undo botched commits.\n\n•   git-push(1) to publish the bleeding edge.\n",
                "subsections": [
                    {
                        "name": "Examples",
                        "content": "A typical integrator’s Git day.\n\n$ git status (1)\n$ git branch --no-merged master (2)\n$ mailx (3)\n& s 2 3 4 5 ./+to-apply\n& s 7 8 ./+hold-linus\n& q\n$ git switch -c topic/one master\n$ git am -3 -i -s ./+to-apply (4)\n$ compile/test\n$ git switch -c hold/linus && git am -3 -i -s ./+hold-linus (5)\n$ git switch topic/one && git rebase master (6)\n$ git switch -C seen next (7)\n$ git merge topic/one topic/two && git merge hold/linus (8)\n$ git switch maint\n$ git cherry-pick master~4 (9)\n$ compile/test\n$ git tag -s -m \"GIT 0.99.9x\" v0.99.9x (10)\n$ git fetch ko && for branch in master maint next seen (11)\ndo\ngit show-branch ko/$branch $branch (12)\ndone\n$ git push --follow-tags ko (13)\n\n1. see what you were in the middle of doing, if anything.\n2. see which branches haven’t been merged into master yet. Likewise for any other\nintegration branches e.g.  maint, next and seen.\n3. read mails, save ones that are applicable, and save others that are not quite ready\n(other mail readers are available).\n4. apply them, interactively, with your sign-offs.\n5. create topic branch as needed and apply, again with sign-offs.\n6. rebase internal topic branch that has not been merged to the master or exposed as a\npart of a stable branch.\n7. restart seen every time from the next.\n8. and bundle topic branches still cooking.\n9. backport a critical fix.\n10. create a signed tag.\n11. make sure master was not accidentally rewound beyond that already pushed out.\n12. In the output from git show-branch, master should have everything ko/master has, and\nnext should have everything ko/next has, etc.\n13. push out the bleeding edge, together with new tags that point into the pushed\nhistory.\n\nIn this example, the ko shorthand points at the Git maintainer’s repository at kernel.org,\nand looks like this:\n\n(in .git/config)\n[remote \"ko\"]\nurl = kernel.org:/pub/scm/git/git.git\nfetch = refs/heads/*:refs/remotes/ko/*\npush = refs/heads/master\npush = refs/heads/next\npush = +refs/heads/seen\npush = refs/heads/maint\n\n"
                    }
                ]
            },
            "REPOSITORY ADMINISTRATION": {
                "content": "A repository administrator uses the following tools to set up and maintain access to the\nrepository by developers.\n\n•   git-daemon(1) to allow anonymous download from repository.\n\n•   git-shell(1) can be used as a restricted login shell for shared central repository users.\n\n•   git-http-backend(1) provides a server side implementation of Git-over-HTTP (\"Smart http\")\nallowing both fetch and push services.\n\n•   gitweb(1) provides a web front-end to Git repositories, which can be set-up using the\ngit-instaweb(1) script.\n\nupdate hook howto[1] has a good example of managing a shared central repository.\n\nIn addition there are a number of other widely deployed hosting, browsing and reviewing\nsolutions such as:\n\n•   gitolite, gerrit code review, cgit and others.\n",
                "subsections": [
                    {
                        "name": "Examples",
                        "content": "We assume the following in /etc/services\n\n$ grep 9418 /etc/services\ngit             9418/tcp                # Git Version Control System\n\n\nRun git-daemon to serve /pub/scm from inetd.\n\n$ grep git /etc/inetd.conf\ngit     stream  tcp     nowait  nobody \\\n/usr/bin/git-daemon git-daemon --inetd --export-all /pub/scm\n\nThe actual configuration line should be on one line.\n\nRun git-daemon to serve /pub/scm from xinetd.\n\n$ cat /etc/xinetd.d/git-daemon\n# default: off\n# description: The Git server offers access to Git repositories\nservice git\n{\ndisable = no\ntype            = UNLISTED\nport            = 9418\nsockettype     = stream\nwait            = no\nuser            = nobody\nserver          = /usr/bin/git-daemon\nserverargs     = --inetd --export-all --base-path=/pub/scm\nlogonfailure  += USERID\n}\n\nCheck your xinetd(8) documentation and setup, this is from a Fedora system. Others might\nbe different.\n\nGive push/pull only access to developers using git-over-ssh.\ne.g. those using: $ git push/pull ssh://host.xz/pub/scm/project\n\n$ grep git /etc/passwd (1)\nalice:x:1000:1000::/home/alice:/usr/bin/git-shell\nbob:x:1001:1001::/home/bob:/usr/bin/git-shell\ncindy:x:1002:1002::/home/cindy:/usr/bin/git-shell\ndavid:x:1003:1003::/home/david:/usr/bin/git-shell\n$ grep git /etc/shells (2)\n/usr/bin/git-shell\n\n1. log-in shell is set to /usr/bin/git-shell, which does not allow anything but git push\nand git pull. The users require ssh access to the machine.\n2. in many distributions /etc/shells needs to list what is used as the login shell.\n\nCVS-style shared repository.\n\n$ grep git /etc/group (1)\ngit:x:9418:alice,bob,cindy,david\n$ cd /home/devo.git\n$ ls -l (2)\nlrwxrwxrwx   1 david git    17 Dec  4 22:40 HEAD -> refs/heads/master\ndrwxrwsr-x   2 david git  4096 Dec  4 22:40 branches\n-rw-rw-r--   1 david git    84 Dec  4 22:40 config\n-rw-rw-r--   1 david git    58 Dec  4 22:40 description\ndrwxrwsr-x   2 david git  4096 Dec  4 22:40 hooks\n-rw-rw-r--   1 david git 37504 Dec  4 22:40 index\ndrwxrwsr-x   2 david git  4096 Dec  4 22:40 info\ndrwxrwsr-x   4 david git  4096 Dec  4 22:40 objects\ndrwxrwsr-x   4 david git  4096 Nov  7 14:58 refs\ndrwxrwsr-x   2 david git  4096 Dec  4 22:40 remotes\n$ ls -l hooks/update (3)\n-r-xr-xr-x   1 david git  3536 Dec  4 22:40 update\n$ cat info/allowed-users (4)\nrefs/heads/master       alice\\|cindy\nrefs/heads/doc-update   bob\nrefs/tags/v[0-9]*       david\n\n1. place the developers into the same git group.\n2. and make the shared repository writable by the group.\n3. use update-hook example by Carl from Documentation/howto/ for branch policy control.\n4. alice and cindy can push into master, only bob can push into doc-update. david is the\nrelease manager and is the only person who can create and push version tags.\n"
                    }
                ]
            },
            "GIT": {
                "content": "Part of the git(1) suite\n",
                "subsections": []
            },
            "NOTES": {
                "content": "1. update hook howto\nfile:///usr/share/doc/git/html/howto/update-hook-example.html\n\n\n\nGit 2.34.1                                   02/26/2026                               GITEVERYDAY(7)",
                "subsections": []
            }
        }
    }
}