{"id":7193,"date":"2026-09-30T15:56:37","date_gmt":"2026-09-30T20:56:37","guid":{"rendered":"https:\/\/ykim.synology.me\/wordpress\/git-cli-command-line-interface-7193\/"},"modified":"2026-09-30T15:56:48","modified_gmt":"2026-09-30T20:56:48","slug":"git-cli-command-line-interface","status":"publish","type":"post","link":"https:\/\/ykim.synology.me\/wordpress\/git-cli-command-line-interface-7193\/","title":{"rendered":"Git CLI (Command Line Interface)"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large is-resized\"><img decoding=\"async\" src=\"https:\/\/github.com\/yBarn1\/Images\/blob\/main\/produce\/yellow-bell-peppers-produce-bin.jpg?raw=true\" alt=\"\" style=\"width:auto;height:500px\"\/><\/figure>\n\n\n<p><div class=\"github-readme-container markdown-body\"><div id=\"file\" class=\"md\" data-path=\"GitHub\/git-cli-ko.md\"><article class=\"markdown-body entry-content container-lg\" itemprop=\"text\"><div class=\"markdown-heading\" dir=\"auto\"><h1 class=\"heading-element\" dir=\"auto\">Git CLI (Command Line Interface)<\/h1><a id=\"user-content-git-cli-command-line-interface\" class=\"anchor\" aria-label=\"Permalink: Git CLI (Command Line Interface)\" href=\"#git-cli-command-line-interface\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<p dir=\"auto\">Rev. 108 | Created: 2026-06-17 | Updated: 2026-09-07 23:03 UTC<\/p>\n<p dir=\"auto\">\uc790\uc8fc \uc4f0\ub294 git \uba85\ub839\uc744 \uc791\uc5c5 \uc601\uc5ed\uacfc \uc5ed\ud560\ub85c \ubd84\ub958\ud55c\ub2e4. <code>&lt;BRANCH&gt;<\/code>, <code>&lt;COMMIT&gt;<\/code>, <code>&lt;FILE&gt;<\/code>, <code>&lt;PATH&gt;<\/code>,\n<code>&lt;URL&gt;<\/code> \uacfc \uac19\uc740 \uc790\ub9ac\ud45c\uc2dc\uc790\ub294 \uc2e4\uc81c \uc774\ub984\uc73c\ub85c \ubc14\uafd4 \uc4f4\ub2e4. \ubb38\ubc95\uc740 PowerShell \uacfc bash \uc5d0\uc11c \uacf5\ud1b5\uc774\ub2e4. \ubb38\uc11c\uc5d0\uc11c\n\uc0ac\uc6a9\ud55c \uc6a9\uc5b4\uc758 \uc815\uc758\ub294 <a href=\"#appendix-a-terminology\">Appendix A. Terminology<\/a> \uc5d0 \uc815\ub9ac\ud55c\ub2e4.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h2 class=\"heading-element\" dir=\"auto\">1. Four Standard Areas<\/h2><a id=\"user-content-1-four-standard-areas\" class=\"anchor\" aria-label=\"Permalink: 1. Four Standard Areas\" href=\"#1-four-standard-areas\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<p dir=\"auto\">File \uc740 \uc544\ub798 \ub124 \uc601\uc5ed\uc744 \uc624\uac04\ub2e4. \ub300\ubd80\ubd84\uc758 \uba85\ub839\uc740 \uc5b4\ub290 \uc601\uc5ed\uc5d0\uc11c \uc5b4\ub290 \uc601\uc5ed\uc73c\ub85c \uc62e\uae30\ub294\uac00\ub85c \uc774\ud574\ud558\uba74\n\uc27d\ub2e4.<\/p>\n<div class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\"[ Local ]                                           [ Remote ]\n---------------------------------------------------------------+------------------\n 1. Working tree  ---&gt;  2. Stage (index)  ---&gt;  3. Local repo  ---&gt;  4. Remote repo\n       |                        |                     |                      |\n       |     [git add]          |                     |                      |\n       |-----------------------&gt;|                     |                      |\n       |                        |    [git commit]     |                      |\n       |                        |--------------------&gt;|                      |\n       |                        |                     |     [git push]       |\n       |                        |                     |---------------------&gt;|\n       |                        |                     |                      |\n       |&lt;---------------------------------------------+----------------------|\n       |                             [git clone \/ git pull]                  |\"><pre lang=\"text\" class=\"notranslate\"><code>&#91; Local &#93;                                           &#91; Remote &#93;\n---------------------------------------------------------------+------------------\n 1. Working tree  ---&gt;  2. Stage (index)  ---&gt;  3. Local repo  ---&gt;  4. Remote repo\n       |                        |                     |                      |\n       |     &#91;git add&#93;          |                     |                      |\n       |-----------------------&gt;|                     |                      |\n       |                        |    &#91;git commit&#93;     |                      |\n       |                        |--------------------&gt;|                      |\n       |                        |                     |     &#91;git push&#93;       |\n       |                        |                     |---------------------&gt;|\n       |                        |                     |                      |\n       |&lt;---------------------------------------------+----------------------|\n       |                             &#91;git clone \/ git pull&#93;                  |\n<\/code><\/pre><\/div>\n<p dir=\"auto\">Fig 1. File movement between the four standard areas.<\/p>\n<p dir=\"auto\">Table 1. The four standard areas and their commands.<\/p>\n<markdown-accessiblity-table><table>\n<thead>\n<tr>\n<th>Area<\/th>\n<th>Meaning<\/th>\n<th>Commands<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Working tree<\/td>\n<td>\ud3b8\uc9d1 \uc911\uc778 \uc2e4\uc81c file \uc774 \ub193\uc778 \uc601\uc5ed\uc774\ub2e4<\/td>\n<td><code>restore<\/code>, <code>checkout<\/code>, <code>switch<\/code><\/td>\n<\/tr>\n<tr>\n<td>Stage (index)<\/td>\n<td>\ub2e4\uc74c commit \uc5d0 \ub2f4\uc544 \ub454 \ubcc0\uacbd\uc774\ub2e4<\/td>\n<td><code>add<\/code>, <code>restore --staged<\/code><\/td>\n<\/tr>\n<tr>\n<td>Local repository<\/td>\n<td>Commit \ub418\uc5b4 history \uc5d0 \uad73\uc740 \uc0c1\ud0dc\ub2e4<\/td>\n<td><code>commit<\/code>, <code>reset<\/code>, <code>revert<\/code><\/td>\n<\/tr>\n<tr>\n<td>Remote repository<\/td>\n<td>Server \uc5d0 \uc788\ub294 \uacf5\uc720 repository \ub2e4<\/td>\n<td><code>push<\/code>, <code>fetch<\/code>, <code>pull<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table><\/markdown-accessiblity-table>\n<div class=\"markdown-heading\" dir=\"auto\"><h2 class=\"heading-element\" dir=\"auto\">2. Repository Lifecycle<\/h2><a id=\"user-content-2-repository-lifecycle\" class=\"anchor\" aria-label=\"Permalink: 2. Repository Lifecycle\" href=\"#2-repository-lifecycle\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<p dir=\"auto\">Repository \ub294 \ub9cc\ub4e4\uc5b4\uc838 remote \uc5d0 \uc62c\ub77c\uac00\uac70\ub098, \ubcf5\uc81c\ub418\uc5b4 \ub0b4\ub824\uc624\uace0, \uc6b4\uc601\ub418\ub2e4 \uc0ad\uc81c\ub418\ub294 lifecycle \uc744\n\uac70\uce5c\ub2e4. Repository \ub2e8\uc704 \uba85\ub839\uc744 \ub2e8\uacc4\ubcc4\ub85c \ubaa8\uc740\ub2e4.<\/p>\n<div class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\"Creation -&gt; Publish (-&gt; remote) -&gt; Track (&lt;- remote) -&gt; Management -&gt; Deletion\"><pre lang=\"text\" class=\"notranslate\"><code>Creation -&gt; Publish (-&gt; remote) -&gt; Track (&lt;- remote) -&gt; Management -&gt; Deletion\n<\/code><\/pre><\/div>\n<p dir=\"auto\">Fig 2. Repository lifecycle stages.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">2.1. Creation<\/h3><a id=\"user-content-21-creation\" class=\"anchor\" aria-label=\"Permalink: 2.1. Creation\" href=\"#21-creation\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<p dir=\"auto\">\ube48 folder \ub97c \uc0c8 repository \ub85c \ub9cc\ub4e4\uc5b4 <code>.git<\/code> \uc744 \uc0dd\uc131\ud55c\ub2e4.<\/p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git init                                   # turn the current folder into a new git repo\ngit init -b main                           # start with the default branch named main\"><pre>git init                                   <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> turn the current folder into a new git repo<\/span>\ngit init -b main                           <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> start with the default branch named main<\/span><\/pre><\/div>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">2.2. Publish<\/h3><a id=\"user-content-22-publish\" class=\"anchor\" aria-label=\"Permalink: 2.2. Publish\" href=\"#22-publish\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<p dir=\"auto\">Local repository \ub97c remote \uc5d0 \uc5f0\uacb0\ud574 \ucc98\uc74c \uc62c\ub9b0\ub2e4.<\/p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git remote add origin &lt;URL&gt;                # link a remote under the name 'origin'\ngit push -u origin main                    # first upload; set the tracking link\"><pre>git remote add origin <span class=\"pl-k\">&lt;<\/span>URL<span class=\"pl-k\">&gt;<\/span>                <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> link a remote under the name 'origin'<\/span>\ngit push -u origin main                    <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> first upload; set the tracking link<\/span><\/pre><\/div>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">2.3. Track<\/h3><a id=\"user-content-23-track\" class=\"anchor\" aria-label=\"Permalink: 2.3. Track\" href=\"#23-track\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<p dir=\"auto\">Remote repository \ub97c \ud1b5\uc9f8\ub85c \ubc1b\uc544 local \uc5d0 \ubcf5\uc81c\ud55c\ub2e4.<\/p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git clone &lt;URL&gt;                            # copy a remote repo down in full\ngit clone -b &lt;BRANCH&gt; &lt;URL&gt;                # clone a specific branch\ngit clone --depth 1 &lt;URL&gt;                  # shallow clone with recent history only\"><pre>git clone <span class=\"pl-k\">&lt;<\/span>URL<span class=\"pl-k\">&gt;<\/span>                            <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> copy a remote repo down in full<\/span>\ngit clone -b <span class=\"pl-k\">&lt;<\/span>BRANCH<span class=\"pl-k\">&gt;<\/span> <span class=\"pl-k\">&lt;<\/span>URL<span class=\"pl-k\">&gt;<\/span>                <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> clone a specific branch<\/span>\ngit clone --depth 1 <span class=\"pl-k\">&lt;<\/span>URL<span class=\"pl-k\">&gt;<\/span>                  <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> shallow clone with recent history only<\/span><\/pre><\/div>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">2.4. Management<\/h3><a id=\"user-content-24-management\" class=\"anchor\" aria-label=\"Permalink: 2.4. Management\" href=\"#24-management\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<p dir=\"auto\">Remote \uc5f0\uacb0\uacfc \uc124\uc815\uc744 \ud655\uc778\ud558\uace0 \uc218\uc815\ud55c\ub2e4.<\/p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git remote -v                              # list linked remotes with fetch and push URLs\ngit remote set-url origin &lt;URL&gt;            # change origin's URL\ngit remote rename &lt;OLD&gt; &lt;NEW&gt;              # rename a remote\ngit config --list                          # show the active config\"><pre>git remote -v                              <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> list linked remotes with fetch and push URLs<\/span>\ngit remote set-url origin <span class=\"pl-k\">&lt;<\/span>URL<span class=\"pl-k\">&gt;<\/span>            <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> change origin's URL<\/span>\ngit remote rename <span class=\"pl-k\">&lt;<\/span>OLD<span class=\"pl-k\">&gt;<\/span> <span class=\"pl-k\">&lt;<\/span>NEW<span class=\"pl-k\">&gt;<\/span>              <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> rename a remote<\/span>\ngit config --list                          <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> show the active config<\/span><\/pre><\/div>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">2.5. Deletion<\/h3><a id=\"user-content-25-deletion\" class=\"anchor\" aria-label=\"Permalink: 2.5. Deletion\" href=\"#25-deletion\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<p dir=\"auto\">Repository \ub098 remote \uc5f0\uacb0\uc744 \uc815\ub9ac\ud55c\ub2e4.<\/p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git remote remove origin                   # drop only the remote link; the local repo stays\nrm -rf .git                                # revert to a plain folder; history is lost\"><pre>git remote remove origin                   <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> drop only the remote link; the local repo stays<\/span>\nrm -rf .git                                <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> revert to a plain folder; history is lost<\/span><\/pre><\/div>\n<p dir=\"auto\">Remote repository \uc790\uccb4\ub294 hosting service \uc758 \uc124\uc815 \ud654\uba74\uc5d0\uc11c \uc0ad\uc81c\ud558\uba70, git \uba85\ub839\uc73c\ub85c\ub294 \uc9c0\uc6cc\uc9c0\uc9c0 \uc54a\ub294\ub2e4.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h2 class=\"heading-element\" dir=\"auto\">3. Branch Lifecycle<\/h2><a id=\"user-content-3-branch-lifecycle\" class=\"anchor\" aria-label=\"Permalink: 3. Branch Lifecycle\" href=\"#3-branch-lifecycle\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<p dir=\"auto\">Branch \ub294 \ub9cc\ub4e4\uc5b4\uc838 remote \uc5d0 \uc62c\ub77c\uac00\uace0, \ub2e4\ub978 \uc0ac\ub78c\uc774 \ubc1b\uc544 \ub2e4\ub4ec\ub2e4\uac00, \uc791\uc5c5\uc774 \ub05d\ub098\uba74 \uc0ad\uc81c\ub41c\ub2e4.\nLifecycle \uc744 \ub2e8\uacc4\ub85c \ub098\ub204\uc5b4 \ud575\uc2ec\ub9cc \uc815\ub9ac\ud55c\ub2e4.<\/p>\n<div class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\"Creation -&gt; Publish (-&gt; remote) -&gt; Track (&lt;- remote) -&gt; Management -&gt; Deletion\"><pre lang=\"text\" class=\"notranslate\"><code>Creation -&gt; Publish (-&gt; remote) -&gt; Track (&lt;- remote) -&gt; Management -&gt; Deletion\n<\/code><\/pre><\/div>\n<p dir=\"auto\">Fig 3. Branch lifecycle stages.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">3.1. Creation<\/h3><a id=\"user-content-31-creation\" class=\"anchor\" aria-label=\"Permalink: 3.1. Creation\" href=\"#31-creation\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<p dir=\"auto\">\uc0c8 branch \ub97c \ub9cc\ub4e4\uace0 \uadf8 \uc704\uc5d0\uc11c \uc791\uc5c5\uc744 \uc2dc\uc791\ud55c\ub2e4.<\/p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git switch -c &lt;BRANCH&gt;                     # create a branch and switch to it\ngit branch &lt;BRANCH&gt;                        # create only, do not switch\ngit switch -c &lt;BRANCH&gt; &lt;START_POINT&gt;       # branch off a specific commit or branch\"><pre>git switch -c <span class=\"pl-k\">&lt;<\/span>BRANCH<span class=\"pl-k\">&gt;<\/span>                     <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> create a branch and switch to it<\/span>\ngit branch <span class=\"pl-k\">&lt;<\/span>BRANCH<span class=\"pl-k\">&gt;<\/span>                        <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> create only, do not switch<\/span>\ngit switch -c <span class=\"pl-k\">&lt;<\/span>BRANCH<span class=\"pl-k\">&gt;<\/span> <span class=\"pl-k\">&lt;<\/span>START_POINT<span class=\"pl-k\">&gt;<\/span>       <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> branch off a specific commit or branch<\/span><\/pre><\/div>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">3.2. Publish<\/h3><a id=\"user-content-32-publish\" class=\"anchor\" aria-label=\"Permalink: 3.2. Publish\" href=\"#32-publish\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<p dir=\"auto\">Local branch \ub97c remote \uc5d0 \uc62c\ub824 \uacf5\uc720\ud55c\ub2e4. \ucc98\uc74c \uc62c\ub9b4 \ub54c tracking \uad00\uacc4\ub97c \ub9fa\ub294\ub2e4.<\/p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git push -u origin &lt;BRANCH&gt;                # first upload; set the tracking link\ngit push                                   # push the current branch once tracking is set\"><pre>git push -u origin <span class=\"pl-k\">&lt;<\/span>BRANCH<span class=\"pl-k\">&gt;<\/span>                <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> first upload; set the tracking link<\/span>\ngit push                                   <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> push the current branch once tracking is set<\/span><\/pre><\/div>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">3.3. Track<\/h3><a id=\"user-content-33-track\" class=\"anchor\" aria-label=\"Permalink: 3.3. Track\" href=\"#33-track\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<p dir=\"auto\">Remote \uc5d0\ub9cc \uc788\ub294 branch \ub97c \ubc1b\uc544 \uadf8 \uc704\uc5d0\uc11c \uc791\uc5c5\ud55c\ub2e4.<\/p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git fetch                                  # fetch remote branch info only\ngit switch &lt;BRANCH&gt;                        # create and track a remote branch of the same name\ngit switch -c &lt;LOCAL&gt; origin\/&lt;BRANCH&gt;      # make a tracking branch from a named remote branch\"><pre>git fetch                                  <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> fetch remote branch info only<\/span>\ngit switch <span class=\"pl-k\">&lt;<\/span>BRANCH<span class=\"pl-k\">&gt;<\/span>                        <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> create and track a remote branch of the same name<\/span>\ngit switch -c <span class=\"pl-k\">&lt;<\/span>LOCAL<span class=\"pl-k\">&gt;<\/span> origin\/<span class=\"pl-k\">&lt;<\/span>BRANCH<span class=\"pl-k\">&gt;<\/span>      <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> make a tracking branch from a named remote branch<\/span><\/pre><\/div>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">3.4. Management<\/h3><a id=\"user-content-34-management\" class=\"anchor\" aria-label=\"Permalink: 3.4. Management\" href=\"#34-management\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<p dir=\"auto\">Branch \ub97c \ud655\uc778\ud558\uace0, \uc774\ub984\uc744 \ubc14\uafb8\uace0, \ucd5c\uc2e0 \uc0c1\ud0dc\ub85c \ub9de\ucd98\ub2e4.<\/p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git branch                                 # list local branches; * marks the current one\ngit branch -a                              # include remote-tracking branches\ngit branch -m &lt;OLD&gt; &lt;NEW&gt;                  # rename a branch\ngit pull                                   # bring the current branch up to remote\ngit merge &lt;BRANCH&gt;                         # merge another branch into the current one\"><pre>git branch                                 <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> list local branches; * marks the current one<\/span>\ngit branch -a                              <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> include remote-tracking branches<\/span>\ngit branch -m <span class=\"pl-k\">&lt;<\/span>OLD<span class=\"pl-k\">&gt;<\/span> <span class=\"pl-k\">&lt;<\/span>NEW<span class=\"pl-k\">&gt;<\/span>                  <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> rename a branch<\/span>\ngit pull                                   <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> bring the current branch up to remote<\/span>\ngit merge <span class=\"pl-k\">&lt;<\/span>BRANCH<span class=\"pl-k\">&gt;<\/span>                         <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> merge another branch into the current one<\/span><\/pre><\/div>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">3.5. Deletion<\/h3><a id=\"user-content-35-deletion\" class=\"anchor\" aria-label=\"Permalink: 3.5. Deletion\" href=\"#35-deletion\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<p dir=\"auto\">\uc791\uc5c5\uc774 \ub05d\ub09c branch \ub97c local \uacfc remote \uc591\ucabd\uc5d0\uc11c \uc815\ub9ac\ud55c\ub2e4.<\/p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git branch -d &lt;BRANCH&gt;                     # delete a merged local branch; -D forces it\ngit push origin --delete &lt;BRANCH&gt;          # delete the remote branch\ngit fetch --prune                          # clean up refs for branches gone from remote\"><pre>git branch -d <span class=\"pl-k\">&lt;<\/span>BRANCH<span class=\"pl-k\">&gt;<\/span>                     <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> delete a merged local branch; -D forces it<\/span>\ngit push origin --delete <span class=\"pl-k\">&lt;<\/span>BRANCH<span class=\"pl-k\">&gt;<\/span>          <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> delete the remote branch<\/span>\ngit fetch --prune                          <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> clean up refs for branches gone from remote<\/span><\/pre><\/div>\n<div class=\"markdown-heading\" dir=\"auto\"><h2 class=\"heading-element\" dir=\"auto\">4. External Repositories<\/h2><a id=\"user-content-4-external-repositories\" class=\"anchor\" aria-label=\"Permalink: 4. External Repositories\" href=\"#4-external-repositories\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<p dir=\"auto\">Main repository \uc548\uc5d0 \ub2e4\ub978 repository \ub97c \ud2b9\uc815 commit \uc73c\ub85c \uace0\uc815\ud574 \ud558\uc704 folder \ub85c \ub123\ub294\ub2e4. \ub450 \uac00\uc9c0\n\ubc29\uc2dd\uc774 \uc788\uc73c\uba70, submodule \uc740 pointer \ub9cc \ub450\uace0 subtree \ub294 code \ub97c \ud1b5\uc9f8\ub85c \ud569\uce5c\ub2e4.<\/p>\n<p dir=\"auto\">Table 2. Submodule versus subtree.<\/p>\n<markdown-accessiblity-table><table>\n<thead>\n<tr>\n<th>Aspect<\/th>\n<th>Submodule<\/th>\n<th>Subtree<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Storage<\/td>\n<td>Commit \uc744 \uac00\ub9ac\ud0a4\ub294 pointer \ub9cc \ub2f4\ub294\ub2e4<\/td>\n<td>File \uc744 main history \uc5d0 \ud569\uccd0 \ub2f4\ub294\ub2e4<\/td>\n<\/tr>\n<tr>\n<td>Nested <code>.git<\/code><\/td>\n<td>Folder \uc548\uc5d0 \uc790\uccb4 <code>.git<\/code> \uc774 \uc788\ub2e4<\/td>\n<td>\uc5c6\uc73c\uba70 main repository \uac00 \uc804\ubd80\ub2e4<\/td>\n<\/tr>\n<tr>\n<td>Extra file<\/td>\n<td><code>.gitmodules<\/code> \uac00 \uc0dd\uc131\ub41c\ub2e4<\/td>\n<td>\uc5c6\ub2e4<\/td>\n<\/tr>\n<tr>\n<td>Clone<\/td>\n<td><code>--recurse-submodules<\/code> \uac19\uc740 \ucd94\uac00 \uc791\uc5c5\uc774 \ud544\uc694\ud558\ub2e4<\/td>\n<td>Clone \ub9cc\uc73c\ub85c \ub05d\ub09c\ub2e4<\/td>\n<\/tr>\n<tr>\n<td>Push<\/td>\n<td>Folder \ub85c \uc774\ub3d9\ud574 \uc9c1\uc811 push \ud55c\ub2e4<\/td>\n<td><code>git subtree push<\/code> \ub97c \uc4f4\ub2e4<\/td>\n<\/tr>\n<tr>\n<td>Best for<\/td>\n<td>Version \uace0\uc815\uacfc \ub3c5\ub9bd \uad00\ub9ac\uc5d0 \uc801\ud569\ud558\ub2e4<\/td>\n<td>\uc758\uc874 code \ub97c \ud488\uc5b4 \ub2e8\uc21c\ud654\ud558\ub294 \ub370 \uc801\ud569\ud558\ub2e4<\/td>\n<\/tr>\n<\/tbody>\n<\/table><\/markdown-accessiblity-table>\n<p dir=\"auto\"><code>git subtree<\/code> \ub294 \ubaa8\ub4e0 \ud558\uc704 \uba85\ub839\uc744 repository \uc758 root folder \uc5d0\uc11c \uc2e4\ud589\ud574\uc57c \ud55c\ub2e4. \ud558\uc704 folder \uc5d0\uc11c\n\uc2e4\ud589\ud558\uba74 git \uc774 toplevel \uc774 \uc544\ub2c8\ub77c\uba70 \uba85\ub839\uc744 \uac70\ubd80\ud558\ubbc0\ub85c, <code>--prefix<\/code> \uc5d0 \uc801\ub294 \uacbd\ub85c\ub3c4 root \ub97c \uae30\uc900\uc73c\ub85c\n\uc4f4\ub2e4. <code>git submodule<\/code> \uc740 \uac15\uc81c\ub418\uc9c0\ub294 \uc54a\uc73c\ub098 \uac19\uc740 \uc774\uc720\ub85c root \uc5d0\uc11c \uc2e4\ud589\ud558\uae30\ub97c \uad8c\uc7a5\ud55c\ub2e4.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">4.1. Creation<\/h3><a id=\"user-content-41-creation\" class=\"anchor\" aria-label=\"Permalink: 4.1. Creation\" href=\"#41-creation\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<p dir=\"auto\">\ub2e4\ub978 repository \ub97c \ud558\uc704 folder \ub85c \ucc98\uc74c \ub354\ud574 nesting \uc744 \ub9cc\ub4dc\ub294 \ub2e8\uacc4\uc774\uba70, \ub450 \ubc29\uc2dd \uc911 \ud558\ub098\ub97c \uace0\ub978\ub2e4.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h4 class=\"heading-element\" dir=\"auto\">Submodule \u2014 link by pointer<\/h4><a id=\"user-content-submodule--link-by-pointer\" class=\"anchor\" aria-label=\"Permalink: Submodule \u2014 link by pointer\" href=\"#submodule--link-by-pointer\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<p dir=\"auto\">\ud558\uc704 folder \uc5d0 \ub2e4\ub978 repository \ub97c \ud2b9\uc815 commit pointer \ub85c \ub454\ub2e4. Main repository \uc5d0\ub294 \uc8fc\uc18c\uc640\ncommit hash \ub9cc \uae30\ub85d\ub418\uace0, \uc2e4\uc81c file \uc740 \uac01\uc790\uc758 repository \uac00 \uad00\ub9ac\ud55c\ub2e4.<\/p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git submodule add &lt;URL&gt; &lt;PATH&gt;             # add another repo as a submodule at &lt;PATH&gt;\ngit submodule add -b &lt;BRANCH&gt; &lt;URL&gt; &lt;PATH&gt; # add based on a specific branch\ngit submodule status                       # show which commit each submodule points to\"><pre>git submodule add <span class=\"pl-k\">&lt;<\/span>URL<span class=\"pl-k\">&gt;<\/span> <span class=\"pl-k\">&lt;<\/span>PATH<span class=\"pl-k\">&gt;<\/span>             <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> add another repo as a submodule at &lt;PATH&gt;<\/span>\ngit submodule add -b <span class=\"pl-k\">&lt;<\/span>BRANCH<span class=\"pl-k\">&gt;<\/span> <span class=\"pl-k\">&lt;<\/span>URL<span class=\"pl-k\">&gt;<\/span> <span class=\"pl-k\">&lt;<\/span>PATH<span class=\"pl-k\">&gt;<\/span> <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> add based on a specific branch<\/span>\ngit submodule status                       <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> show which commit each submodule points to<\/span><\/pre><\/div>\n<p dir=\"auto\">Version \uc744 \uc62c\ub9b4 \ub54c\ub294 submodule \uc744 \uc6d0\ud558\ub294 commit \uc73c\ub85c \uc62e\uae34 \ub4a4, main repository \uc5d0\uc11c \uadf8 pointer\n\ubcc0\ud654\ub97c commit \ud55c\ub2e4.<\/p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"cd &lt;PATH&gt;\ngit checkout &lt;COMMIT&gt;                      # set the submodule to the wanted commit\ncd ..\ngit add &lt;PATH&gt;\ngit commit -m &quot;bump submodule&quot;             # record the new pointer in the main repo\"><pre><span class=\"pl-c1\">cd<\/span> <span class=\"pl-k\">&lt;<\/span>PATH<span class=\"pl-k\">&gt;<\/span>\ngit checkout <span class=\"pl-k\">&lt;<\/span>COMMIT<span class=\"pl-k\">&gt;<\/span>                      <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> set the submodule to the wanted commit<\/span>\n<span class=\"pl-c1\">cd<\/span> ..\ngit add <span class=\"pl-k\">&lt;<\/span>PATH<span class=\"pl-k\">&gt;<\/span>\ngit commit -m <span class=\"pl-s\"><span class=\"pl-pds\">\"<\/span>bump submodule<span class=\"pl-pds\">\"<\/span><\/span>             <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> record the new pointer in the main repo<\/span><\/pre><\/div>\n<p dir=\"auto\">Main repository \uc5d0\ub294 submodule \uc758 commit hash \ub9cc \ub2f4\uae30\ubbc0\ub85c, \ubc1b\ub294 \ucabd\uc740 \uc2e4\uc81c file \uc744 \ub530\ub85c \ubc1b\uc544\n\ucc44\uc6cc\uc57c \ud55c\ub2e4.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h4 class=\"heading-element\" dir=\"auto\">Subtree \u2014 merge code in<\/h4><a id=\"user-content-subtree--merge-code-in\" class=\"anchor\" aria-label=\"Permalink: Subtree \u2014 merge code in\" href=\"#subtree--merge-code-in\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<p dir=\"auto\">\ub2e4\ub978 repository \uc758 file \uc744 main history \uc548\uc73c\ub85c \ud1b5\uc9f8\ub85c \ud569\uccd0 \ud558\uc704 folder \uc5d0 \ub454\ub2e4. \ubc1b\ub294 \uc0ac\ub78c\uc740 \ubcc4\ub3c4\n\uba85\ub839 \uc5c6\uc774 \ubcf4\ud1b5 folder \ucc98\ub7fc \ubc14\ub85c \uc4f0\uba70 <code>.gitmodules<\/code> \ub3c4 \uc0dd\uae30\uc9c0 \uc54a\ub294\ub2e4.<\/p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"# run these from the repository root; &lt;PATH&gt; is relative to that root\ngit subtree add --prefix=&lt;PATH&gt; &lt;URL&gt; &lt;BRANCH&gt; --squash   # add a repo at &lt;PATH&gt;\ngit subtree push --prefix=&lt;PATH&gt; &lt;URL&gt; &lt;BRANCH&gt;           # push &lt;PATH&gt; changes back to that remote\"><pre><span class=\"pl-c\"><span class=\"pl-c\">#<\/span> run these from the repository root; &lt;PATH&gt; is relative to that root<\/span>\ngit subtree add --prefix=<span class=\"pl-k\">&lt;<\/span>PATH<span class=\"pl-k\">&gt;<\/span> <span class=\"pl-k\">&lt;<\/span>URL<span class=\"pl-k\">&gt;<\/span> <span class=\"pl-k\">&lt;<\/span>BRANCH<span class=\"pl-k\">&gt;<\/span> --squash   <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> add a repo at &lt;PATH&gt;<\/span>\ngit subtree push --prefix=<span class=\"pl-k\">&lt;<\/span>PATH<span class=\"pl-k\">&gt;<\/span> <span class=\"pl-k\">&lt;<\/span>URL<span class=\"pl-k\">&gt;<\/span> <span class=\"pl-k\">&lt;<\/span>BRANCH<span class=\"pl-k\">&gt;<\/span>           <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> push &lt;PATH&gt; changes back to that remote<\/span><\/pre><\/div>\n<p dir=\"auto\"><code>--squash<\/code> \ub294 \uac00\uc838\uc628 history \ub97c \ud558\ub098\uc758 commit \uc73c\ub85c \ub20c\ub7ec main history \ub97c \uae54\ub054\ud558\uac8c \uc720\uc9c0\ud55c\ub2e4. \uc774\noption \uc744 \ube7c\uba74 \uc6d0\ubcf8 commit \uc774 \uadf8\ub300\ub85c \uc11e\uc5ec \ub4e4\uc5b4\uc628\ub2e4.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">4.2. Track<\/h3><a id=\"user-content-42-track\" class=\"anchor\" aria-label=\"Permalink: 4.2. Track\" href=\"#42-track\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<p dir=\"auto\">Main repository \ub97c \ubc1b\uc740 \ub4a4 nested \ub0b4\uc6a9\uc744 \ucc44\uc6b4\ub2e4. Subtree \ub294 main history \uc5d0 \uc774\ubbf8 \ub4e4\uc5b4 \uc788\uc5b4\n<code>clone<\/code> \ub9cc\uc73c\ub85c \ub530\ub77c\uc624\uace0, submodule \uc740 pointer \ub9cc \uc788\uc5b4 \ub530\ub85c \ubc1b\uc544 \ucc44\uc6cc\uc57c \ud55c\ub2e4.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h4 class=\"heading-element\" dir=\"auto\">Submodule \u2014 populate from remote<\/h4><a id=\"user-content-submodule--populate-from-remote\" class=\"anchor\" aria-label=\"Permalink: Submodule \u2014 populate from remote\" href=\"#submodule--populate-from-remote\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<p dir=\"auto\">Submodule \uc740 \ubcf5\uc81c \uc9c1\ud6c4 folder \uac00 \ube44\uc5b4 \uc788\ub2e4. \ub0b4\uc6a9\uc744 \ubc1b\uc544 \ucc44\uc6b0\uace0 remote \ucd5c\uc2e0 \uc0c1\ud0dc\ub85c \ub9de\ucd98\ub2e4.<\/p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git clone --recurse-submodules &lt;URL&gt;       # clone the main repo and fetch submodules together\ngit submodule update --init --recursive    # if already cloned, populate submodule contents\ngit submodule update --remote &lt;PATH&gt;       # update the submodule to the remote's latest commit\"><pre>git clone --recurse-submodules <span class=\"pl-k\">&lt;<\/span>URL<span class=\"pl-k\">&gt;<\/span>       <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> clone the main repo and fetch submodules together<\/span>\ngit submodule update --init --recursive    <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> if already cloned, populate submodule contents<\/span>\ngit submodule update --remote <span class=\"pl-k\">&lt;<\/span>PATH<span class=\"pl-k\">&gt;<\/span>       <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> update the submodule to the remote's latest commit<\/span><\/pre><\/div>\n<div class=\"markdown-heading\" dir=\"auto\"><h4 class=\"heading-element\" dir=\"auto\">Subtree \u2014 pull from remote<\/h4><a id=\"user-content-subtree--pull-from-remote\" class=\"anchor\" aria-label=\"Permalink: Subtree \u2014 pull from remote\" href=\"#subtree--pull-from-remote\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<p dir=\"auto\">Subtree \ub294 <code>clone<\/code> \uc73c\ub85c \uc774\ubbf8 \ub530\ub77c\uc624\ubbc0\ub85c, \uc6d0\ubcf8 repository \uc758 \uc0c8 \ubcc0\uacbd\ub9cc \uac00\uc838\uc640 \uac31\uc2e0\ud55c\ub2e4.<\/p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"# run from the repository root as well\ngit subtree pull --prefix=&lt;PATH&gt; &lt;URL&gt; &lt;BRANCH&gt; --squash  # pull new changes into &lt;PATH&gt;\"><pre><span class=\"pl-c\"><span class=\"pl-c\">#<\/span> run from the repository root as well<\/span>\ngit subtree pull --prefix=<span class=\"pl-k\">&lt;<\/span>PATH<span class=\"pl-k\">&gt;<\/span> <span class=\"pl-k\">&lt;<\/span>URL<span class=\"pl-k\">&gt;<\/span> <span class=\"pl-k\">&lt;<\/span>BRANCH<span class=\"pl-k\">&gt;<\/span> --squash  <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> pull new changes into &lt;PATH&gt;<\/span><\/pre><\/div>\n<div class=\"markdown-heading\" dir=\"auto\"><h4 class=\"heading-element\" dir=\"auto\">Worktree \u2014 pin a version<\/h4><a id=\"user-content-worktree--pin-a-version\" class=\"anchor\" aria-label=\"Permalink: Worktree \u2014 pin a version\" href=\"#worktree--pin-a-version\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<p dir=\"auto\">Submodule \uacfc subtree \uc5c6\uc774, \ub2e4\ub978 repository \uc758 \ud2b9\uc815 commit \ub9cc \ud558\uc704 folder \ub85c \ud3bc\uccd0 \uace0\uc815\ud574 \uc4f4\ub2e4.<\/p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git clone &lt;URL&gt; &lt;DEP&gt;                      # clone the other repo once into &lt;DEP&gt;\ngit -C &lt;DEP&gt; worktree add &lt;PATH&gt; &lt;COMMIT&gt;  # unfold &lt;DEP&gt;'s commit into &lt;PATH&gt;\ngit -C &lt;DEP&gt; worktree remove &lt;PATH&gt;        # remove the unfolded folder when done\"><pre>git clone <span class=\"pl-k\">&lt;<\/span>URL<span class=\"pl-k\">&gt;<\/span> <span class=\"pl-k\">&lt;<\/span>DEP<span class=\"pl-k\">&gt;<\/span>                      <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> clone the other repo once into &lt;DEP&gt;<\/span>\ngit -C <span class=\"pl-k\">&lt;<\/span>DEP<span class=\"pl-k\">&gt;<\/span> worktree add <span class=\"pl-k\">&lt;<\/span>PATH<span class=\"pl-k\">&gt;<\/span> <span class=\"pl-k\">&lt;<\/span>COMMIT<span class=\"pl-k\">&gt;<\/span>  <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> unfold &lt;DEP&gt;'s commit into &lt;PATH&gt;<\/span>\ngit -C <span class=\"pl-k\">&lt;<\/span>DEP<span class=\"pl-k\">&gt;<\/span> worktree remove <span class=\"pl-k\">&lt;<\/span>PATH<span class=\"pl-k\">&gt;<\/span>        <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> remove the unfolded folder when done<\/span><\/pre><\/div>\n<p dir=\"auto\">Worktree \ub85c \ud3bc\uce5c folder \ub294 \ub2e4\ub978 repository \uc758 \uc0ac\ubcf8\uc774\ubbc0\ub85c, main repository \uc5d0\uc11c\ub294 \ubcf4\ud1b5\n<code>.gitignore<\/code> \ub85c \uc81c\uc678\ud574 main history \uc5d0 \ub2f4\uc9c0 \uc54a\ub294\ub2e4.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h2 class=\"heading-element\" dir=\"auto\">5. Commands<\/h2><a id=\"user-content-5-commands\" class=\"anchor\" aria-label=\"Permalink: 5. Commands\" href=\"#5-commands\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<p dir=\"auto\">\uc5ed\ud560\ubcc4\ub85c \ubb36\uc740 \uba85\ub839\uc774\uba70, \ub300\ubd80\ubd84 \uc55e\uc758 \ub124 \uc601\uc5ed \uc0ac\uc774\uc5d0\uc11c \ubb34\uc5b8\uac00\ub97c \uc62e\uae34\ub2e4.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">5.1. Stage and Commit<\/h3><a id=\"user-content-51-stage-and-commit\" class=\"anchor\" aria-label=\"Permalink: 5.1. Stage and Commit\" href=\"#51-stage-and-commit\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<p dir=\"auto\">\ubcc0\uacbd\uc744 \uace8\ub77c stage \uc5d0 \ub2f4\uace0 history \ub85c \uad73\ud78c\ub2e4.<\/p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git status                                 # see changes and staging at a glance\ngit add &lt;FILE&gt;                             # stage a specific file\ngit add .                                  # stage all changes in the current folder\ngit restore --staged &lt;FILE&gt;                # unstage but keep the working-tree changes\n\ngit commit -m &quot;&lt;MESSAGE&gt;&quot;                  # record staged changes into history\ngit commit -am &quot;&lt;MESSAGE&gt;&quot;                 # add and commit tracked files at once\ngit commit --amend -m &quot;&lt;MESSAGE&gt;&quot;          # rewrite the last commit before it is pushed\"><pre>git status                                 <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> see changes and staging at a glance<\/span>\ngit add <span class=\"pl-k\">&lt;<\/span>FILE<span class=\"pl-k\">&gt;<\/span>                             <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> stage a specific file<\/span>\ngit add <span class=\"pl-c1\">.<\/span>                                  <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> stage all changes in the current folder<\/span>\ngit restore --staged <span class=\"pl-k\">&lt;<\/span>FILE<span class=\"pl-k\">&gt;<\/span>                <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> unstage but keep the working-tree changes<\/span>\n\ngit commit -m <span class=\"pl-s\"><span class=\"pl-pds\">\"<\/span>&lt;MESSAGE&gt;<span class=\"pl-pds\">\"<\/span><\/span>                  <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> record staged changes into history<\/span>\ngit commit -am <span class=\"pl-s\"><span class=\"pl-pds\">\"<\/span>&lt;MESSAGE&gt;<span class=\"pl-pds\">\"<\/span><\/span>                 <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> add and commit tracked files at once<\/span>\ngit commit --amend -m <span class=\"pl-s\"><span class=\"pl-pds\">\"<\/span>&lt;MESSAGE&gt;<span class=\"pl-pds\">\"<\/span><\/span>          <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> rewrite the last commit before it is pushed<\/span><\/pre><\/div>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">5.2. History<\/h3><a id=\"user-content-52-history\" class=\"anchor\" aria-label=\"Permalink: 5.2. History\" href=\"#52-history\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<p dir=\"auto\">History \ub97c \ud6d1\uace0, commit \uc218\ub97c \uc138\uace0, ref \ub97c commit hash \ub85c \ud480\uc5b4 \ubcf8\ub2e4.<\/p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git log --oneline                          # browse commits, one line each\ngit rev-list --count HEAD                  # count all commits up to HEAD\ngit rev-list --count HEAD &lt;FILE&gt;           # count only commits that touched that file\n\ngit rev-parse main                         # print the full commit hash that main points to\ngit rev-parse --short main                 # print the shortened hash\ngit rev-parse HEAD                         # print the current commit's hash\"><pre>git log --oneline                          <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> browse commits, one line each<\/span>\ngit rev-list --count HEAD                  <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> count all commits up to HEAD<\/span>\ngit rev-list --count HEAD <span class=\"pl-k\">&lt;<\/span>FILE<span class=\"pl-k\">&gt;<\/span>           <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> count only commits that touched that file<\/span>\n\ngit rev-parse main                         <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> print the full commit hash that main points to<\/span>\ngit rev-parse --short main                 <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> print the shortened hash<\/span>\ngit rev-parse HEAD                         <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> print the current commit's hash<\/span><\/pre><\/div>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">5.3. Stash<\/h3><a id=\"user-content-53-stash\" class=\"anchor\" aria-label=\"Permalink: 5.3. Stash\" href=\"#53-stash\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<p dir=\"auto\">Commit \ud558\uae30\uc5d0 \uc774\ub978 \ubcc0\uacbd\uc744 \uc7a0\uc2dc \uce58\uc6cc \ub450\uace0, \uae68\ub057\ud55c \uc0c1\ud0dc\uc5d0\uc11c \ub2e4\ub978 \uc791\uc5c5\uc744 \ud55c\ub2e4.<\/p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git stash                                  # shelve working changes and clear the working tree\ngit stash -u                               # shelve untracked new files too\ngit stash list                             # list shelved entries\ngit stash show -p stash@{0}                # show a specific entry's changes\n\ngit stash pop                              # restore the latest entry and drop it from the list\ngit stash apply stash@{1}                  # restore a chosen entry but keep it in the list\ngit stash drop stash@{0}                   # discard a specific entry\ngit stash clear                            # clear all entries\"><pre>git stash                                  <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> shelve working changes and clear the working tree<\/span>\ngit stash -u                               <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> shelve untracked new files too<\/span>\ngit stash list                             <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> list shelved entries<\/span>\ngit stash show -p stash@{0}                <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> show a specific entry's changes<\/span>\n\ngit stash pop                              <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> restore the latest entry and drop it from the list<\/span>\ngit stash apply stash@{1}                  <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> restore a chosen entry but keep it in the list<\/span>\ngit stash drop stash@{0}                   <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> discard a specific entry<\/span>\ngit stash clear                            <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> clear all entries<\/span><\/pre><\/div>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">5.4. Branch and Switch<\/h3><a id=\"user-content-54-branch-and-switch\" class=\"anchor\" aria-label=\"Permalink: 5.4. Branch and Switch\" href=\"#54-branch-and-switch\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<p dir=\"auto\">Branch \ub97c \ub9cc\ub4e4\uace0 \uc624\uac04\ub2e4. <code>switch<\/code> \ub294 branch \uc774\ub3d9 \uc804\uc6a9\uc774\uace0, <code>checkout<\/code> \uc740 \uc774\ub3d9\uacfc \ubcf5\uc6d0\uc744 \uacb8\ud558\ub358\n\uc608\uc804 \uba85\ub839\uc774\ub2e4.<\/p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git branch                                 # list local branches; * marks the current one\ngit branch -a                              # include remote-tracking branches\ngit branch &lt;BRANCH&gt;                        # create a branch without switching\ngit branch -d &lt;BRANCH&gt;                     # delete a merged branch; -D forces it\ngit branch -m &lt;OLD&gt; &lt;NEW&gt;                  # rename a branch\n\ngit switch &lt;BRANCH&gt;                        # switch to a branch\ngit switch -c &lt;BRANCH&gt;                     # create a branch and switch to it\ngit checkout &lt;BRANCH&gt;                      # switch branch the old way\"><pre>git branch                                 <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> list local branches; * marks the current one<\/span>\ngit branch -a                              <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> include remote-tracking branches<\/span>\ngit branch <span class=\"pl-k\">&lt;<\/span>BRANCH<span class=\"pl-k\">&gt;<\/span>                        <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> create a branch without switching<\/span>\ngit branch -d <span class=\"pl-k\">&lt;<\/span>BRANCH<span class=\"pl-k\">&gt;<\/span>                     <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> delete a merged branch; -D forces it<\/span>\ngit branch -m <span class=\"pl-k\">&lt;<\/span>OLD<span class=\"pl-k\">&gt;<\/span> <span class=\"pl-k\">&lt;<\/span>NEW<span class=\"pl-k\">&gt;<\/span>                  <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> rename a branch<\/span>\n\ngit switch <span class=\"pl-k\">&lt;<\/span>BRANCH<span class=\"pl-k\">&gt;<\/span>                        <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> switch to a branch<\/span>\ngit switch -c <span class=\"pl-k\">&lt;<\/span>BRANCH<span class=\"pl-k\">&gt;<\/span>                     <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> create a branch and switch to it<\/span>\ngit checkout <span class=\"pl-k\">&lt;<\/span>BRANCH<span class=\"pl-k\">&gt;<\/span>                      <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> switch branch the old way<\/span><\/pre><\/div>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">5.5. Sync<\/h3><a id=\"user-content-55-sync\" class=\"anchor\" aria-label=\"Permalink: 5.5. Sync\" href=\"#55-sync\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<p dir=\"auto\">Remote \uc640 \uc8fc\uace0\ubc1b\ub294\ub2e4. <code>fetch<\/code> \ub294 \ubc1b\uae30\ub9cc \ud558\uace0, <code>pull<\/code> \uc740 \ubc1b\uc544 \ud569\uce58\uba70, <code>push<\/code> \ub294 \uc62c\ub9b0\ub2e4.<\/p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git fetch                                  # fetch the latest remote history only\ngit fetch --prune                          # also clean refs for branches gone from remote\n\ngit pull                                   # fetch and merge into the current branch\ngit pull --rebase                          # fetch, then rebase instead of merge\n\ngit push                                   # push the current branch to the remote\ngit push -u origin &lt;BRANCH&gt;                # first upload; set the tracking link\ngit push --force-with-lease                # push rewritten history without overwriting others' work\"><pre>git fetch                                  <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> fetch the latest remote history only<\/span>\ngit fetch --prune                          <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> also clean refs for branches gone from remote<\/span>\n\ngit pull                                   <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> fetch and merge into the current branch<\/span>\ngit pull --rebase                          <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> fetch, then rebase instead of merge<\/span>\n\ngit push                                   <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> push the current branch to the remote<\/span>\ngit push -u origin <span class=\"pl-k\">&lt;<\/span>BRANCH<span class=\"pl-k\">&gt;<\/span>                <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> first upload; set the tracking link<\/span>\ngit push --force-with-lease                <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> push rewritten history without overwriting others' work<\/span><\/pre><\/div>\n<p dir=\"auto\">\ubc29\ud5a5\uc5d0 \ub530\ub77c \ubc14\ub00c\ub294 \ub300\uc0c1\uc774 \ub2e4\ub974\ub2e4. Local \uc5d0\uc11c remote \ub85c \uac00\ub294 <code>git push<\/code> \ub294 remote \uc758 \uc0c1\ud0dc\ub97c\n\ubc14\uafb8\uace0, remote \uc5d0\uc11c local \ub85c \uc624\ub294 <code>git fetch<\/code> \uc640 <code>git pull<\/code> \uc740 local \uc758 remote-tracking branch\n\uc0c1\ud0dc\ub97c \ubc14\uafbc\ub2e4.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">5.6. Integrate<\/h3><a id=\"user-content-56-integrate\" class=\"anchor\" aria-label=\"Permalink: 5.6. Integrate\" href=\"#56-integrate\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<p dir=\"auto\">\ub450 branch \uc758 history \ub97c \ud569\uce5c\ub2e4. <code>merge<\/code> \ub294 \ud569\uce5c \uc790\uad6d\uc778 merge commit \uc744 \ub0a8\uae30\uace0, <code>rebase<\/code> \ub294\ncommit \uc744 \uc62e\uaca8 \ubd99\uc5ec \ud55c \uc904\ub85c \ud3b8\ub2e4.<\/p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git merge &lt;BRANCH&gt;                         # merge the given branch into the current one\ngit merge --abort                          # undo a conflict-stalled merge\n\ngit rebase &lt;BRANCH&gt;                        # replay the current branch's commits onto &lt;BRANCH&gt;\ngit rebase --continue                      # after resolving conflicts, continue the rebase\ngit rebase --abort                         # stop the rebase and return to the start\"><pre>git merge <span class=\"pl-k\">&lt;<\/span>BRANCH<span class=\"pl-k\">&gt;<\/span>                         <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> merge the given branch into the current one<\/span>\ngit merge --abort                          <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> undo a conflict-stalled merge<\/span>\n\ngit rebase <span class=\"pl-k\">&lt;<\/span>BRANCH<span class=\"pl-k\">&gt;<\/span>                        <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> replay the current branch's commits onto &lt;BRANCH&gt;<\/span>\ngit rebase --continue                      <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> after resolving conflicts, continue the rebase<\/span>\ngit rebase --abort                         <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> stop the rebase and return to the start<\/span><\/pre><\/div>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">5.7. Undo<\/h3><a id=\"user-content-57-undo\" class=\"anchor\" aria-label=\"Permalink: 5.7. Undo\" href=\"#57-undo\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<p dir=\"auto\">\ub418\ub3cc\ub9ac\uae30\ub294 \uc5b4\ub290 \uc601\uc5ed\uc744 \ub418\ub3cc\ub9ac\ub294\uac00\uc5d0 \ub530\ub77c \uac08\ub9b0\ub2e4.<\/p>\n<p dir=\"auto\">Table 3. Undo commands by target area.<\/p>\n<markdown-accessiblity-table><table>\n<thead>\n<tr>\n<th>Command<\/th>\n<th>Target<\/th>\n<th>State<\/th>\n<th>Working tree<\/th>\n<th>Commit history<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>restore &lt;FILE&gt;<\/code><\/td>\n<td>Working tree \uc758 file<\/td>\n<td>modified \uc5d0\uc11c committed \ub85c \ub418\ub3cc\ub9ac\uace0 \ubcc0\uacbd\uc744 \ubc84\ub9b0\ub2e4<\/td>\n<td>\ubcf5\uc6d0\ub41c\ub2e4<\/td>\n<td>\ubc14\ub00c\uc9c0 \uc54a\ub294\ub2e4<\/td>\n<\/tr>\n<tr>\n<td><code>restore --staged &lt;FILE&gt;<\/code><\/td>\n<td>Stage<\/td>\n<td>staged \uc5d0\uc11c modified \ub85c \ub418\ub3cc\ub9b0\ub2e4<\/td>\n<td>\uc720\uc9c0\ub41c\ub2e4<\/td>\n<td>\ubc14\ub00c\uc9c0 \uc54a\ub294\ub2e4<\/td>\n<\/tr>\n<tr>\n<td><code>checkout &lt;COMMIT&gt;<\/code><\/td>\n<td>HEAD \uc704\uce58<\/td>\n<td>\uc9c0\uc815\ud55c commit \uae30\uc900\uc73c\ub85c \ub9de\ucd98\ub2e4<\/td>\n<td>\uad50\uccb4\ub41c\ub2e4<\/td>\n<td>HEAD \ub9cc \uc774\ub3d9\ud558\uace0 \ubcf4\uc874\ub41c\ub2e4<\/td>\n<\/tr>\n<tr>\n<td><code>reset --soft<\/code><\/td>\n<td>Commit \uc704\uce58<\/td>\n<td>committed \uc5d0\uc11c staged \ub85c \ub418\ub3cc\ub9b0\ub2e4<\/td>\n<td>\uc720\uc9c0\ub41c\ub2e4<\/td>\n<td>\uc774\ub3d9\ud55c\ub2e4<\/td>\n<\/tr>\n<tr>\n<td><code>reset --mixed<\/code><\/td>\n<td>Commit \uacfc stage<\/td>\n<td>committed \uc5d0\uc11c modified \ub85c \ub418\ub3cc\ub9b0\ub2e4<\/td>\n<td>\uc720\uc9c0\ub41c\ub2e4<\/td>\n<td>\uc774\ub3d9\ud55c\ub2e4<\/td>\n<\/tr>\n<tr>\n<td><code>reset --hard<\/code><\/td>\n<td>Commit \uacfc stage \uc640 working tree<\/td>\n<td>committed \uc5d0\uc11c clean \uc73c\ub85c \ub418\ub3cc\ub9ac\uace0 \ubcc0\uacbd\uc744 \ubc84\ub9b0\ub2e4<\/td>\n<td>\uc0ad\uc81c\ub41c\ub2e4<\/td>\n<td>\uc774\ub3d9\ud55c\ub2e4<\/td>\n<\/tr>\n<tr>\n<td><code>revert &lt;COMMIT&gt;<\/code><\/td>\n<td>\ud2b9\uc815 commit \uc758 \ud6a8\uacfc<\/td>\n<td>\uc0c8 commit \uc744 \ucd94\uac00\ud55c\ub2e4<\/td>\n<td>\uac31\uc2e0\ub41c\ub2e4<\/td>\n<td>\uc0c8 commit \uc73c\ub85c \uc0c1\uc1c4\ud55c\ub2e4<\/td>\n<\/tr>\n<\/tbody>\n<\/table><\/markdown-accessiblity-table>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"# restore the working tree to the last commit state\ngit restore &lt;FILE&gt;                         # restore one file\ngit restore .                              # discard all working-tree changes\n\n# move HEAD and set the whole working tree to another commit\ngit checkout &lt;COMMIT&gt;                      # HEAD goes detached\ngit checkout -- &lt;FILE&gt;                     # discard one file's changes, the old form\n\n# move the commit position\ngit reset --soft HEAD~1                    # undo the commit only, keep changes staged\ngit reset --mixed HEAD~1                   # undo commit and staging, keep working-tree changes\ngit reset --hard HEAD~1                    # discard commit, staging, and working tree\n\n# offset a commit and safely reverse already-shared history\ngit revert &lt;COMMIT&gt;                        # make a new commit that undoes that one\"><pre><span class=\"pl-c\"><span class=\"pl-c\">#<\/span> restore the working tree to the last commit state<\/span>\ngit restore <span class=\"pl-k\">&lt;<\/span>FILE<span class=\"pl-k\">&gt;<\/span>                         <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> restore one file<\/span>\ngit restore <span class=\"pl-c1\">.<\/span>                              <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> discard all working-tree changes<\/span>\n\n<span class=\"pl-c\"><span class=\"pl-c\">#<\/span> move HEAD and set the whole working tree to another commit<\/span>\ngit checkout <span class=\"pl-k\">&lt;<\/span>COMMIT<span class=\"pl-k\">&gt;<\/span>                      <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> HEAD goes detached<\/span>\ngit checkout -- <span class=\"pl-k\">&lt;<\/span>FILE<span class=\"pl-k\">&gt;<\/span>                     <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> discard one file's changes, the old form<\/span>\n\n<span class=\"pl-c\"><span class=\"pl-c\">#<\/span> move the commit position<\/span>\ngit reset --soft HEAD~1                    <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> undo the commit only, keep changes staged<\/span>\ngit reset --mixed HEAD~1                   <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> undo commit and staging, keep working-tree changes<\/span>\ngit reset --hard HEAD~1                    <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> discard commit, staging, and working tree<\/span>\n\n<span class=\"pl-c\"><span class=\"pl-c\">#<\/span> offset a commit and safely reverse already-shared history<\/span>\ngit revert <span class=\"pl-k\">&lt;<\/span>COMMIT<span class=\"pl-k\">&gt;<\/span>                        <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> make a new commit that undoes that one<\/span><\/pre><\/div>\n<p dir=\"auto\">\uc544\uc9c1 \uc62c\ub9ac\uc9c0 \uc54a\uc740 \uc791\uc5c5\uc744 \uc815\ub9ac\ud560 \ub54c\ub294 <code>reset<\/code> \uc744 \uc4f0\uace0, \uc774\ubbf8 push \ud55c commit \uc744 \ub4a4\uc9d1\uc744 \ub54c\ub294 <code>revert<\/code>\n\ub97c \uc4f0\uba70, \ud3b8\uc9d1\ub9cc \ubc84\ub9b4 \ub54c\ub294 <code>restore<\/code> \ub97c \uc4f4\ub2e4.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h3 class=\"heading-element\" dir=\"auto\">5.8. Extraction<\/h3><a id=\"user-content-58-extraction\" class=\"anchor\" aria-label=\"Permalink: 5.8. Extraction\" href=\"#58-extraction\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<p dir=\"auto\"><code>checkout<\/code> \uc774 local state \uc640 working tree \ub97c \ud568\uaed8 \ubc14\uafb8\ub294 undo \ub77c\uba74, <code>worktree<\/code> \uc640 <code>archive<\/code> \ub294\nworking tree \ub9cc \ubc14\uafb8\ub294 extraction \uc774\ub2e4.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h4 class=\"heading-element\" dir=\"auto\">Worktree<\/h4><a id=\"user-content-worktree\" class=\"anchor\" aria-label=\"Permalink: Worktree\" href=\"#worktree\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<p dir=\"auto\">\ud55c repository \uc5d0 working tree \ub97c \uc5ec\ub7ec \uac1c \ub450\uc5b4, branch \ub9c8\ub2e4 \ubcc4\ub3c4 folder \uc5d0\uc11c \ub3d9\uc2dc\uc5d0 \uc791\uc5c5\ud55c\ub2e4. \uac01\nfolder \ub294 \uac19\uc740 <code>.git<\/code> history \ub97c \uacf5\uc720\ud55c\ub2e4.<\/p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git worktree list                          # list all attached working trees\ngit worktree add ..\/feat &lt;BRANCH&gt;          # unfold &lt;BRANCH&gt; into ..\/feat\ngit worktree add -b &lt;BRANCH&gt; ..\/feat       # create a branch and unfold it into ..\/feat\ngit worktree add --detach ..\/tmp &lt;COMMIT&gt;  # check out a commit without a branch\n\ngit worktree remove ..\/feat                # remove a working tree\ngit worktree prune                         # clean records whose .git pointer is broken\ngit worktree prune --verbose               # also show what was cleaned\ngit worktree prune --dry-run               # preview without deleting\"><pre>git worktree list                          <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> list all attached working trees<\/span>\ngit worktree add ..\/feat <span class=\"pl-k\">&lt;<\/span>BRANCH<span class=\"pl-k\">&gt;<\/span>          <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> unfold &lt;BRANCH&gt; into ..\/feat<\/span>\ngit worktree add -b <span class=\"pl-k\">&lt;<\/span>BRANCH<span class=\"pl-k\">&gt;<\/span> ..\/feat       <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> create a branch and unfold it into ..\/feat<\/span>\ngit worktree add --detach ..\/tmp <span class=\"pl-k\">&lt;<\/span>COMMIT<span class=\"pl-k\">&gt;<\/span>  <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> check out a commit without a branch<\/span>\n\ngit worktree remove ..\/feat                <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> remove a working tree<\/span>\ngit worktree prune                         <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> clean records whose .git pointer is broken<\/span>\ngit worktree prune --verbose               <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> also show what was cleaned<\/span>\ngit worktree prune --dry-run               <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> preview without deleting<\/span><\/pre><\/div>\n<p dir=\"auto\">\uac19\uc740 branch \ub97c \ub450 working tree \uc5d0 \ub3d9\uc2dc\uc5d0 \ud3bc\uce60 \uc218\ub294 \uc5c6\ub2e4. \ud55c commit \ub9cc \uc7a0\uae50 \ud655\uc778\ud560 \ub54c\ub294\n<code>--detach<\/code> \uac00 \uae54\ub054\ud558\ub2e4.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h4 class=\"heading-element\" dir=\"auto\">Archive<\/h4><a id=\"user-content-archive\" class=\"anchor\" aria-label=\"Permalink: Archive\" href=\"#archive\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<p dir=\"auto\">Branch \ub098 commit \uc758 \ud55c \uc2dc\uc810\uc744 <code>.git<\/code> history \uc5c6\uc774 \uc555\ucd95 file \ub85c \ub0b4\ubcf4\ub0b8\ub2e4. \uc18c\uc2a4\ub9cc \ubb36\uc5b4 \ubc30\ud3ec\ud560 \ub54c\n\uc4f4\ub2e4.<\/p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git archive -o src.zip HEAD                  # bundle the current snapshot as zip\ngit archive --format=tar.gz -o src.tgz HEAD  # bundle as tar.gz\ngit archive -o src.zip &lt;BRANCH&gt;              # bundle a specific branch's snapshot\ngit archive -o sub.zip HEAD:&lt;PATH&gt;           # bundle only a subfolder\ngit archive --prefix=app\/ -o src.zip HEAD    # place bundled files under app\/\"><pre>git archive -o src.zip HEAD                  <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> bundle the current snapshot as zip<\/span>\ngit archive --format=tar.gz -o src.tgz HEAD  <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> bundle as tar.gz<\/span>\ngit archive -o src.zip <span class=\"pl-k\">&lt;<\/span>BRANCH<span class=\"pl-k\">&gt;<\/span>              <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> bundle a specific branch's snapshot<\/span>\ngit archive -o sub.zip HEAD:<span class=\"pl-k\">&lt;<\/span>PATH<span class=\"pl-k\">&gt;<\/span>           <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> bundle only a subfolder<\/span>\ngit archive --prefix=app\/ -o src.zip HEAD    <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> place bundled files under app\/<\/span><\/pre><\/div>\n<p dir=\"auto\"><code>git archive<\/code> \ub294 \ucd94\uc801 \uc911\uc778 file \ub9cc \ub2f4\ub294\ub2e4. <code>.gitignore<\/code> \ub85c \uc81c\uc678\ud55c file \uacfc <code>.git<\/code> folder \ub294 \ube60\uc9c0\ubbc0\ub85c\n\ubc30\ud3ec\uc6a9 snapshot \uc5d0 \uc801\ud569\ud558\ub2e4.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\"><h2 class=\"heading-element\" dir=\"auto\">6. Windows Environment<\/h2><a id=\"user-content-6-windows-environment\" class=\"anchor\" aria-label=\"Permalink: 6. Windows Environment\" href=\"#6-windows-environment\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<p dir=\"auto\">Windows \ub294 \uacbd\ub85c\ub97c 260\uc790\ub85c \uc81c\ud55c\ud55c\ub2e4. Folder \uac00 \uae4a\uc5b4 \uacbd\ub85c\uac00 \uae38\uba74 git \uc791\uc5c5\uc774 \ub9c9\ud788\ubbc0\ub85c \ud655\uc7a5 \uacbd\ub85c API\n\ub97c \ucf20\ub2e4.<\/p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git config --global core.longpaths true    # allow long paths in all repos\ngit config --get core.longpaths            # check whether it is on\"><pre>git config --global core.longpaths <span class=\"pl-c1\">true<\/span>    <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> allow long paths in all repos<\/span>\ngit config --get core.longpaths            <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> check whether it is on<\/span><\/pre><\/div>\n<p dir=\"auto\"><code>--global<\/code> \uc740 \ud604\uc7ac \uc0ac\uc6a9\uc790 \uc804\uccb4\uc5d0 \uc801\uc6a9\ud55c\ub2e4. \ud558\ub098\uc758 repository \uc5d0\ub9cc \uc801\uc6a9\ud558\ub824\uba74 \uadf8 folder \uc5d0\uc11c\n<code>--global<\/code> \uc744 \ube80\ub2e4. Windows \uc790\uccb4 \uc81c\ud55c\uae4c\uc9c0 \ud480\ub824\uba74 \uad00\ub9ac\uc790 \uad8c\ud55c\uc73c\ub85c registry \uc758 <code>LongPathsEnabled<\/code>\n\uac12\uc744 1 \ub85c \ub454\ub2e4.<\/p>\n<p dir=\"auto\">Git for Windows \ubc30\ud3ec\ud310 \uc790\uccb4\ub294 \ub2e4\uc74c \uba85\ub839\uc73c\ub85c \ucd5c\uc2e0\uc73c\ub85c \uc62c\ub9b0\ub2e4.<\/p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git update-git-for-windows                 # update Git for Windows to the latest version\ngit version                                # check the installed git version\"><pre>git update-git-for-windows                 <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> update Git for Windows to the latest version<\/span>\ngit version                                <span class=\"pl-c\"><span class=\"pl-c\">#<\/span> check the installed git version<\/span><\/pre><\/div>\n<p dir=\"auto\">\uc774 \uba85\ub839\uc740 Git for Windows \uc804\uc6a9\uc774\uba70 Git Bash \ub098 CMD \uc5d0\uc11c \uc2e4\ud589\ud55c\ub2e4. \uc0c8 version \uc774 \uc788\uc73c\uba74 \ubc1b\uc544\uc11c\n\uc124\uce58\ud558\uace0, \uc5c6\uc73c\uba74 \ucd5c\uc2e0\uc774\ub77c\uace0 \uc54c\ub824 \uc900\ub2e4.<\/p>\n<hr>\n<div class=\"markdown-heading\" dir=\"auto\"><h2 class=\"heading-element\" dir=\"auto\">Appendix A. Terminology<\/h2><a id=\"user-content-appendix-a-terminology\" class=\"anchor\" aria-label=\"Permalink: Appendix A. Terminology\" href=\"#appendix-a-terminology\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"><\/path><\/svg><\/a><\/div>\n<ul dir=\"auto\">\n<li><strong>.git<\/strong>: Repository \uc758 \ubaa8\ub4e0 \uac83\uc774 \ub2f4\uae34 \uc228\uae40 folder \ub2e4. Commit, branch, history, \uc124\uc815\uc774 \uc5ec\uae30\uc5d0 \ub4e4\uc5b4 \uc788\uc5b4 \uc774 folder \uac00 \uace7 local repository \ub2e4. <code>git init<\/code> \uc73c\ub85c \ub9cc\ub4e4\uc5b4\uc9c0\uac70\ub098 <code>git clone<\/code> \uc73c\ub85c \ubc1b\uc544 \uc624\uba70, \uc9c0\uc6b0\uba74 history \uac00 \uc0ac\ub77c\uc9c0\uace0 \ubcf4\ud1b5 folder \ub85c \ub3cc\uc544\uac04\ub2e4.<\/li>\n<li><strong>.gitattributes<\/strong>: \uacbd\ub85c\ubcc4 \ucde8\uae09 \uaddc\uce59\uc744 \uc801\ub294 file \uc774\ub2e4. \uc904\ubc14\uafc8 \uc815\uaddc\ud654, diff \uc640 merge \ubc29\uc2dd, LFS \uc9c0\uc815 \ub4f1\uc744 \uacbd\ub85c pattern \uc5d0 \uac78\uc5b4 \ub454\ub2e4.<\/li>\n<li><strong>.gitignore<\/strong>: \ucd94\uc801\ud558\uc9c0 \uc54a\uc744 file \uc744 pattern \uc73c\ub85c \uc801\ub294 file \uc774\ub2e4. Build \uc0b0\ucd9c\ubb3c, cache, \ube44\ubc00 key \ub4f1\uc744 \uc801\uc5b4 \ub450\uba74 <code>git status<\/code> \uc640 <code>git add<\/code> \uc5d0\uc11c \ube60\uc9c0\uba70, \uc774\ubbf8 \ucd94\uc801 \uc911\uc778 file \uc5d0\ub294 \uc801\uc6a9\ub418\uc9c0 \uc54a\ub294\ub2e4.<\/li>\n<li><strong>.gitmodules<\/strong>: Submodule \uc758 \uacbd\ub85c\uc640 remote \uc8fc\uc18c\ub97c \uc801\uc5b4 \ub450\ub294 file \uc774\ub2e4. <code>git submodule add<\/code> \ub85c \ucc44\uc6cc\uc9c4\ub2e4.<\/li>\n<li><strong>Branch<\/strong>: Commit \uc744 \uac00\ub9ac\ud0a4\ub294 \uc6c0\uc9c1\uc774\ub294 \uc774\ub984\ud45c\ub2e4. \ubcf8\uc904\uc744 \uac74\ub4dc\ub9ac\uc9c0 \uc54a\uace0 \uac08\ub77c\uc838 \uc791\uc5c5\ud558\ub2e4 \ub098\uc911\uc5d0 \ud569\uce5c\ub2e4.<\/li>\n<li><strong>Commit<\/strong>: \ubcc0\uacbd\uc744 history \uc5d0 \uad73\ud600 \ub0a8\uae34 \uae30\ub85d \ub2e8\uc704\uc774\uba70, \uac01 commit \uc740 \uace0\uc720\ud55c hash \ub85c \uc2dd\ubcc4\ub41c\ub2e4.<\/li>\n<li><strong>Detached HEAD<\/strong>: HEAD \uac00 branch \uac00 \uc544\ub2cc \ud2b9\uc815 commit \uc744 \uc9c1\uc811 \uac00\ub9ac\ud0a4\ub294 \uc0c1\ud0dc\ub2e4. \uc5ec\uae30\uc11c commit \ud558\uba74 \uc5b4\ub290 branch \uc5d0\ub3c4 \ub9e4\uc774\uc9c0 \uc54a\uc544, branch \ub97c \uc0c8\ub85c \ub9cc\ub4e4\uc9c0 \uc54a\uc73c\uba74 \uc783\uae30 \uc27d\ub2e4.<\/li>\n<li><strong>HEAD<\/strong>: \ud604\uc7ac \uc704\uce58\ub97c \uac00\ub9ac\ud0a4\ub294 pointer \ub2e4. \ubcf4\ud1b5 \ud604\uc7ac branch \uc758 \ub9e8 \ub05d commit \uc744 \uac00\ub9ac\ud0a4\uba70, branch \uac00 \uc544\ub2cc \ud2b9\uc815 commit \uc744 \uc9c1\uc811 \uac00\ub9ac\ud0a4\uba74 detached \uc0c1\ud0dc\uac00 \ub41c\ub2e4.<\/li>\n<li><strong>Local repository<\/strong>: \uc791\uc5c5 machine \uc5d0 \uc788\ub294 repository \ub2e4. Commit, branch, history \uac00 <code>.git<\/code> folder \uc5d0 \ub2f4\uaca8 network \uc5c6\uc774\ub3c4 \ubaa8\ub4e0 \uc791\uc5c5\uc774 \uac00\ub2a5\ud558\ub2e4.<\/li>\n<li><strong>Main<\/strong>: \uae30\ubcf8 branch \uc758 \ud604\uc7ac \ud45c\uc900 \uc774\ub984\uc774\uba70 \uc608\uc804\uc758 master \ub97c \ub300\uccb4\ud55c\ub2e4.<\/li>\n<li><strong>Master<\/strong>: \uae30\ubcf8 branch \uc758 \uc61b \ud45c\uc900 \uc774\ub984\uc774\ub2e4. \ub3d9\uc791\uc740 main \uacfc \uac19\uace0 \uc624\ub798\ub41c repository \uc5d0 \ub0a8\uc544 \uc788\ub2e4.<\/li>\n<li><strong>Merge<\/strong>: \ub450 branch \uc758 history \ub97c \ud569\uce58\ub294 \ub3d9\uc791\uc774\uba70, \ud569\uce5c \uc790\uad6d\uc778 merge commit \uc744 \ub0a8\uae34\ub2e4.<\/li>\n<li><strong>Origin<\/strong>: <code>git clone<\/code> \uc2dc \uc790\ub3d9\uc73c\ub85c \ubd99\ub294 remote \uc758 \uae30\ubcf8 \uc774\ub984\uc774\uba70 \uc8fc\uc18c \ub300\uc2e0 \uc4f0\ub294 \ubcc4\uce6d\uc774\ub2e4.<\/li>\n<li><strong>Rebase<\/strong>: \ud604\uc7ac branch \uc758 commit \uc744 \ub2e4\ub978 branch \uc758 \ub05d\uc73c\ub85c \uc62e\uaca8 \ubd99\uc5ec history \ub97c \ud55c \uc904\ub85c \ud3b4\ub294 \ub3d9\uc791\uc774\ub2e4.<\/li>\n<li><strong>Ref<\/strong>: Commit \uc744 \uac00\ub9ac\ud0a4\ub294 \uc774\ub984\uc774\uba70 branch \uc640 <code>HEAD<\/code> \uac00 \uc5ec\uae30\uc5d0 \uc18d\ud55c\ub2e4.<\/li>\n<li><strong>Remote repository<\/strong>: Server \uc5d0 \uc788\ub294 \uacf5\uc720 repository \ub2e4. \uc5ec\ub7ff\uc774 push \uc640 pull \ub85c history \ub97c \uc8fc\uace0\ubc1b\ub294 \uc911\uc2ec\uc810\uc774\ub2e4.<\/li>\n<li><strong>Remote-tracking branch<\/strong>: Remote branch \ub97c local \uc5d0 \ube44\ucdb0 \ub454 \uc77d\uae30\uc6a9 \uc774\ub984\uc774\uba70 <code>fetch<\/code> \ub54c \uac31\uc2e0\ub41c\ub2e4.<\/li>\n<li><strong>Repository<\/strong>: Project \uc758 \ubaa8\ub4e0 file \uacfc history \ub97c \ub2f4\ub294 \uc800\uc7a5 \ub2e8\uc704\uc774\uba70 local \uacfc remote \uc591\ucabd\uc5d0 \uc874\uc7ac\ud55c\ub2e4.<\/li>\n<li><strong>Stage (index)<\/strong>: \ub2e4\uc74c commit \uc5d0 \ub2f4\uc744 \ubcc0\uacbd\uc744 \ubaa8\uc544 \ub450\ub294 \uc601\uc5ed\uc774\uba70 <code>git add<\/code> \ub85c \ucc44\uc6b4\ub2e4.<\/li>\n<li><strong>Stash<\/strong>: Commit \ud558\uae30\uc5d0 \uc774\ub978 working tree \uc758 \ubcc0\uacbd\uc744 \uc7a0\uc2dc \uce58\uc6cc \ub450\ub294 \ubcf4\uad00 \uc7a5\uc18c\ub2e4.<\/li>\n<li><strong>State<\/strong>: \ubcc0\uacbd\ub41c file \uc774 \uac70\uce58\ub294 \ub2e8\uacc4\ub2e4. modified \ub294 working tree \uc5d0\uc11c \uace0\ucce4\uc9c0\ub9cc \uc544\uc9c1 \ub2f4\uc9c0 \uc54a\uc740 \uc0c1\ud0dc\uc774\uace0, staged \ub294 <code>git add<\/code> \ub85c \ub2e4\uc74c commit \uc5d0 \ub2f4\uc740 \uc0c1\ud0dc\uc774\uba70, committed \ub294 <code>git commit<\/code> \uc73c\ub85c history \uc5d0 \uad73\uc740 \uc0c1\ud0dc\ub2e4.<\/li>\n<li><strong>Submodule<\/strong>: \ub2e4\ub978 repository \ub97c \ud2b9\uc815 commit \uc758 pointer \ub85c\ub9cc \ucc38\uc870\ud574 \ud558\uc704 folder \uc5d0 \ub450\ub294 \ubc29\uc2dd\uc774\ub2e4.<\/li>\n<li><strong>Subtree<\/strong>: \ub2e4\ub978 repository \uc758 file \uc744 main history \ub85c \ud569\uccd0 \ud558\uc704 folder \uc5d0 \ub450\ub294 \ubc29\uc2dd\uc774\ub2e4.<\/li>\n<li><strong>Working tree<\/strong>: \ud3b8\uc9d1 \uc911\uc778 \uc2e4\uc81c file \uc774 \ud3bc\uccd0\uc9c4 \uc791\uc5c5 folder \ub2e4. \uace0\uce5c \ub0b4\uc6a9\uc744 <code>git add<\/code> \ub85c stage \uc5d0 \ub2f4\uace0 <code>git commit<\/code> \uc73c\ub85c \uad73\ud78c\ub2e4.<\/li>\n<li><strong>Worktree<\/strong>: \ud55c repository \uc5d0 \uc5f0\uacb0\ub41c \ubcc4\ub3c4\uc758 \uc791\uc5c5 folder \uc774\uba70, \uac19\uc740 <code>.git<\/code> history \ub97c \uacf5\uc720\ud55c\ub2e4.<\/li>\n<\/ul>\n<\/article><\/div><\/div><\/p>\n<div style='text-align:center' class='yasr-auto-insert-overall'><\/div><div style='text-align:center' class='yasr-auto-insert-visitor'><\/div>","protected":false},"excerpt":{"rendered":"<p>A git command reference organized by where a file sits: working tree, stage, local repository, remote repository. Repository and branch commands are grouped by lifecycle stage, from creation through publish, tracking and deletion, and the command sections cover staging, history, stash, sync, integrate, undo and extraction. The syntax is common to PowerShell and bash.<\/p>\n","protected":false},"author":4,"featured_media":7194,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"_kadence_starter_templates_imported_post":false,"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","yasr_overall_rating":0,"yasr_post_is_review":"","yasr_auto_insert_disabled":"","yasr_review_type":"","fifu_image_url":"","fifu_image_alt":"","iawp_total_views":7,"footnotes":""},"categories":[378,10],"tags":[386],"class_list":["post-7193","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-github","category-software-slug","tag-github-hosted"],"yasr_visitor_votes":{"stars_attributes":{"read_only":false,"span_bottom":false},"number_of_votes":0,"sum_votes":0},"jetpack_featured_media_url":"https:\/\/ykim.synology.me\/wordpress\/wp-content\/uploads\/2026\/09\/yellow-bell-peppers-produce-bin.jpg","_links":{"self":[{"href":"https:\/\/ykim.synology.me\/wordpress\/wp-json\/wp\/v2\/posts\/7193","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ykim.synology.me\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ykim.synology.me\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ykim.synology.me\/wordpress\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/ykim.synology.me\/wordpress\/wp-json\/wp\/v2\/comments?post=7193"}],"version-history":[{"count":1,"href":"https:\/\/ykim.synology.me\/wordpress\/wp-json\/wp\/v2\/posts\/7193\/revisions"}],"predecessor-version":[{"id":7195,"href":"https:\/\/ykim.synology.me\/wordpress\/wp-json\/wp\/v2\/posts\/7193\/revisions\/7195"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ykim.synology.me\/wordpress\/wp-json\/wp\/v2\/media\/7194"}],"wp:attachment":[{"href":"https:\/\/ykim.synology.me\/wordpress\/wp-json\/wp\/v2\/media?parent=7193"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ykim.synology.me\/wordpress\/wp-json\/wp\/v2\/categories?post=7193"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ykim.synology.me\/wordpress\/wp-json\/wp\/v2\/tags?post=7193"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}