{"id":65,"date":"2026-05-08T13:34:54","date_gmt":"2026-05-08T04:34:54","guid":{"rendered":"https:\/\/it-blog.kr\/?p=65"},"modified":"2026-06-06T18:20:56","modified_gmt":"2026-06-06T09:20:56","slug":"git","status":"publish","type":"post","link":"https:\/\/it-blog.kr\/?p=65","title":{"rendered":"Git"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Source code\uc758 \ubcc0\uacbd \uc774\ub825\uc744 \ucd94\uc801\ud558\uace0, \uc5ec\ub7ec \uac1c\ubc1c\uc790\uac00 \ud611\uc5c5\ud560 \uc218 \uc788\ub3c4\ub85d \uc9c0\uc6d0\ud558\ub294 \ubd84\uc0b0 \ubc84\uc804 \uad00\ub9ac \uc2dc\uc2a4\ud15c.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Git \ud544\uc694 \uc774\uc720<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\uc544\ub798\uc640 \uac19\uc740 \uc0c1\ud669\uc744 \uacbd\ud5d8\ud55c \uc801 \uc788\uc744 \uac83\uc774\ub2e4.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"765\" height=\"534\" loading=\"lazy\" src=\"https:\/\/it-blog.kr\/wp-content\/uploads\/2026\/05\/image-6.png\" alt=\"\" class=\"wp-image-78\" srcset=\"https:\/\/it-blog.kr\/wp-content\/uploads\/2026\/05\/image-6.png 765w, https:\/\/it-blog.kr\/wp-content\/uploads\/2026\/05\/image-6-300x209.png 300w\" sizes=\"auto, (max-width: 765px) 100vw, 765px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\uac1c\ubc1c\uc744 \ud558\ub2e4 \ubcf4\uba74 \uc704\uc640 \uac19\uc740 \uc0c1\ud669\uc774 \uc815\ud655\ud788 \uc7ac\ud604\ub428. git\uc740 \uc774 \ubb38\uc81c\ub97c \ud574\uacb0\ud55c\ub2e4.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">git\uc740 \ud504\ub85c\uc81d\ud2b8\uc758 \ud0c0\uc784\uba38\uc2e0 \uc774\ub77c\uace0 \ubcf4\uba74 \ub41c\ub2e4. \ud30c\uc77c\uc744 \ubcf5\uc0ac\ud574\uc11c \ubcf4\uad00\ud558\ub294 \uac83\uc774 \uc544\ub2cc, \ubcc0\uacbd\ub41c \ub0b4\uc6a9\uc744 snapshot \ud615\ud0dc\ub85c \ucc28\uace1\ucc28\uace1 \uc313\uc544\ub454\ub2e4.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"701\" height=\"120\" loading=\"lazy\" src=\"https:\/\/it-blog.kr\/wp-content\/uploads\/2026\/05\/image-7.png\" alt=\"\" class=\"wp-image-79\" srcset=\"https:\/\/it-blog.kr\/wp-content\/uploads\/2026\/05\/image-7.png 701w, https:\/\/it-blog.kr\/wp-content\/uploads\/2026\/05\/image-7-300x51.png 300w\" sizes=\"auto, (max-width: 701px) 100vw, 701px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\uc704 \uacfc\uc815\uc758 \uac01 \uc810\uc744 commit \uc774\ub77c\uace0 \ubcf4\uba74 \ub41c\ub2e4.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>commit(commit) &#8211; \uc800\uc7a5 \ubc84\ud2bc\uc774\ub2e4. &#8220;\uc9c0\uae08 \uc774 \uc0c1\ud0dc\ub97c \uae30\ub85d\ud574\uc918&#8221; \ub77c\uace0 git\uc5d0 \uba85\ub839\ud558\ub294\uac83. save point\ub77c\uace0 \ubcf4\uba74\ub428.<\/li>\n\n\n\n<li>repository(\uc800\uc7a5\uc18c) &#8211; \uc904\uc5ec\uc11c repo\ub77c\uace0 \ubd80\ub984. commit\ub4e4\uc774 \uc313\uc774\ub294 \uacf3. \ub0b4 pc\uc5d0 \uc788\ub294 \uac83\uc740 local repository, github\uc5d0 \uc62c\ub9b0 \uac83\uc740 remote repository\uc774\ub2e4.<\/li>\n\n\n\n<li>head &#8211; &#8220;\uc9c0\uae08 \ub0b4\uac00 \ubcf4\uace0 \uc788\ub294 \uc704\uce58&#8221;. timeline\uc5d0\uc11c \ud604\uc7ac \ub0b4 \uc704\uce58\ub97c \uac00\ub9ac\ud0a4\ub294 pointer.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Git\uc758 3\uac00\uc9c0 \uc601\uc5ed<\/h2>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"749\" height=\"142\" loading=\"lazy\" src=\"https:\/\/it-blog.kr\/wp-content\/uploads\/2026\/05\/image-8.png\" alt=\"\" class=\"wp-image-93\" srcset=\"https:\/\/it-blog.kr\/wp-content\/uploads\/2026\/05\/image-8.png 749w, https:\/\/it-blog.kr\/wp-content\/uploads\/2026\/05\/image-8-300x57.png 300w\" sizes=\"auto, (max-width: 749px) 100vw, 749px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Working Directory<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\uc2e4\uc81c\ub85c \ud30c\uc77c\uc744 \uc5f4\uace0 \uc218\uc815\ud558\ub294 \uacf3. Linux\uc758 cwd(current working directory)\uc640 \uac19\ub2e4\uace0 \ubcf4\uba74 \ub428.<\/li>\n\n\n\n<li>\uc5ec\uae30\uc11c \ubb54\uac00\ub97c \uc218\uc815\ud558\ub354\ub77c\ub3c4 git\uc740 \uc544\ubb34\uac83\ub3c4 \ubaa8\ub984.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Staging Area<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>&#8220;\uc774\uac83\ub4e4\uc744 \uc800\uc7a5\ud560 \uac70\uc57c&#8221; \ub77c\uace0 \uace8\ub77c\ub2f4\ub294 \uacf3.\n<ul class=\"wp-block-list\">\n<li>\uc2e4\uc81c path\ub294 .git\/index \uc774\ub2e4. (type: file)<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>&#8220;git add&#8221;\ub85c \ud30c\uc77c\uc744 \uc5ec\uae30\uc5d0 \uc62c\ub9bc.<\/li>\n\n\n\n<li>staging area\uc758 \uc874\uc7ac \uc774\uc720\n<ul class=\"wp-block-list\">\n<li>\ubc14\ub85c \uc800\uc7a5\ud558\uba74 \ub418\ub294\ub370 \uc65c \uc911\uac04 \ub2e8\uacc4\uac00 \uc788\ub294\uc9c0 \uad81\uae08\ud558\ub2e4.<\/li>\n\n\n\n<li>\uc774\uc720\ub294 \uc120\ud0dd\uc801\uc73c\ub85c \uc800\uc7a5\ud558\uae30 \uc704\ud574\uc11c\uc784.<\/li>\n\n\n\n<li>\uc608\ub97c \ub4e4\uc5b4 \ud558\ub8e8\ub3d9\uc548 \ub450\uac00\uc9c0 \uc791\uc5c5\uc744 \ud588\ub2e4\uace0 \ud574\ubd05\uc2dc\ub2e4.\n<ul class=\"wp-block-list\">\n<li>login.js &#8211; \ub85c\uadf8\uc778 \uae30\ub2a5 \uac1c\ubc1c<\/li>\n\n\n\n<li>style.css &#8211; UI \uc0c9\uc0c1 \uc870\uae08 \uc218\uc815<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>\uc774 \ub458\uc744 \ud55c commit\uc5d0 \ubb36\uc73c\uba74 \ub098\uc911\uc5d0 \uc774\ub825\uc744 \ubcfc\ub54c &#8220;\uc774 commit\uc774 \uae30\ub2a5 \ucd94\uac00\uc57c, \ub514\uc790\uc778 \uc218\uc815\uc774\uc57c?&#8221; \ud63c\ub780\uc2a4\ub7ec\uc6b8 \uc218 \uc788\uc74c.<\/li>\n\n\n\n<li>staging area \ub355\ubd84\uc5d0 \ub450\uac00\uc9c0 \uc218\uc815\uc744 \ub530\ub85c commit\ud560 \uc218 \uc788\uc74c.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Repository<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>commit\uc774 \uc601\uad6c \ubcf4\uad00\ub418\ub294 \uacf3.\n<ul class=\"wp-block-list\">\n<li>\uc2e4\uc81c path\ub294 .git\/objects \uc774\ub2e4. (type: directory)<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>&#8220;git commit&#8221;\uc73c\ub85c staging area\uc758 \ub0b4\uc6a9\uc774 \uc5ec\uae30\uc5d0 \ud655\uc815 \uc800\uc7a5\ub428.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">\ud575\uc2ec \uba85\ub839\uc5b4\uc640 \uc601\uc5ed\uc758 \uad00\uacc4<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td><strong>Command<\/strong><\/td><td><strong>Description<\/strong><\/td><\/tr><tr><td>git add &lt;filename&gt;<\/td><td>working dir -&gt; staging area<\/td><\/tr><tr><td>git add .<\/td><td>\ubcc0\uacbd\ub41c \uc804\uccb4 \ud30c\uc77c\uc744 staging \uc73c\ub85c (\ubcc0\uacbd \uc790\ub3d9 \uac10\uc9c0)<\/td><\/tr><tr><td>git commit -m &#8220;&lt;message&gt;&#8221;<\/td><td>staging area -&gt; repository<\/td><\/tr><tr><td>git status<\/td><td>\uac01 \uc601\uc5ed\uc758 \ud604\uc7ac \uc0c1\ud0dc \ud655\uc778<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">git add\uac00 \ud30c\uc77c \ubcc0\uacbd\uc744 \uac10\uc9c0\ud558\ub294 \ubc29\ubc95<br>1. OS Metadata \ube44\uad50<br>    &#8211; \ud30c\uc77c \ud06c\uae30<br>    &#8211; \ucd5c\uc885 \uc218\uc815 \uc2dc\uac04 (mtime)<br>    &#8211; inode \ubc88\ud638<br>    -&gt; metadata \uc77c\uce58\uc5ec\ubd80\uc5d0 \ub530\ub77c \ub2e4\uc74c \ub2e8\uacc4\ub85c \uc774\ub3d9 \uc5ec\ubd80 \uacb0\uc815.<br>2. SHA-1 Hash \uacc4\uc0b0<br>    &#8211; \ud30c\uc77c \ub0b4\uc6a9 \uc804\uccb4\ub97c \uc77d\uc5b4\uc11c Digest \uacc4\uc0b0.<br>    &#8211; .git\/index\uc758 digest\uac12\uacfc \ube44\uad50.<br>    -&gt; digest \uc77c\uce58\uc5ec\ubd80\uc5d0 \ub530\ub77c Staging Area\ub85c \uc774\ub3d9\uc5ec\ubd80 \uacb0\uc815.<br>=&gt; SHA-1 \uacc4\uc0b0\uc740 \ud30c\uc77c\uc744 \uc804\ubd80 \uc77d\uc5b4\uc57c \ud574\uc11c \ud30c\uc77c\uc774 \ud06c\uba74 \ud074\uc218\ub85d \uc2dc\uac04\uc774 \uc624\ub798 \uac78\ub9bc. \ubc18\uba74 metadata \ube44\uad50\ub294 \uc774\ubbf8 staging area(.git\/index)\uc5d0 \ubcf4\uc720\ud558\uace0 \uc788\ub294 head commit\uc758 \uc815\ubcf4\ub97c \ube44\uad50\ud558\uae30\uc5d0 \uac70\uc758 \uc989\uc2dc \ube44\uad50 \uac00\ub2a5.<br>=&gt; \ud30c\uc77c\uc744 \uc218\uc815\ud588\ub2e4\uac00 \ub2e4\uc2dc \uc6d0\ub798\ub300\ub85c \ub418\ub3cc\ub9ac\uba74 metadata\ub294 \ubc14\ub00c\uc5c8\uc9c0\ub9cc SHA-1\uc740 \ub3d9\uc77c\ud558\uae30\uc5d0 \uc774 \uacbd\uc6b0\uc5d0 git\uc740 2\ub2e8\uacc4\uae4c\uc9c0 \ud655\uc778\ud558\uace0 &#8220;\ubcc0\uacbd \uc5c6\uc74c&#8221;\uc73c\ub85c \ucc98\ub9ac\ud568.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Git\uc758 3\uac00\uc9c0 \uc601\uc5ed(\uadf8\ub9ac\uace0, Remote Repository)\uacfc git \uba85\ub839\uc5b4\uc758 \uad00\uacc4\ub97c \uc2dc\uac01\ud654\ud55c\ub2e4\uba74 \uc544\ub798\uc640 \uac19\ub2e4.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"666\" height=\"332\" loading=\"lazy\" src=\"https:\/\/it-blog.kr\/wp-content\/uploads\/2026\/05\/image-9.png\" alt=\"\" class=\"wp-image-94\" srcset=\"https:\/\/it-blog.kr\/wp-content\/uploads\/2026\/05\/image-9.png 666w, https:\/\/it-blog.kr\/wp-content\/uploads\/2026\/05\/image-9-300x150.png 300w\" sizes=\"auto, (max-width: 666px) 100vw, 666px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Commit<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">git\uc740 commit\ub9c8\ub2e4 \ubcc0\uacbd\ub41c \ucc28\uc774(diff)\ub97c \uae30\ub85d\ud558\ub294 \uac83\uc774 \uc544\ub2c8\ub77c, commit \uc2dc\uc810\uc758 \ud504\ub85c\uc81d\ud2b8 \uc804\uccb4 \ud30c\uc77c\uc758 \uc0c1\ud0dc\ub97c \uae30\ub85d\ud568. \uc774\uac83\uc744 snapshot\uc774\ub77c\uace0 \ud568. \ub2e8, \ub611\uac19\uc740 \ud30c\uc77c\uc740 \uc911\ubcf5 \uc800\uc7a5\ud558\uc9c0 \uc54a\uc74c.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">commit object\uc758 \uc2e4\uc81c \ub0b4\ubd80 \uad6c\uc870\ub294 \uc544\ub798\uc640 \uac19\ub2e4.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"694\" height=\"410\" loading=\"lazy\" src=\"https:\/\/it-blog.kr\/wp-content\/uploads\/2026\/05\/image-10.png\" alt=\"\" class=\"wp-image-109\" srcset=\"https:\/\/it-blog.kr\/wp-content\/uploads\/2026\/05\/image-10.png 694w, https:\/\/it-blog.kr\/wp-content\/uploads\/2026\/05\/image-10-300x177.png 300w\" sizes=\"auto, (max-width: 694px) 100vw, 694px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">commit\ub07c\ub9ac\ub294 chain\uc73c\ub85c \uc5f0\uacb0\ub428. \uac01 commit\uc740 parent\ub85c \uc774\uc804 commit\uc744 \uac00\ub9ac\ud0b5\ub2c8\ub2e4. \uc774 chain \ub355\ubd84\uc5d0 git\uc740 \ub450 commit \uc0ac\uc774\uc5d0 \ubb50\uac00 \ubc14\ub00c\uc5c8\uc9c0?\ub97c \uc5b8\uc81c\ub4e0 \uacc4\uc0b0\ud574\ub0bc \uc218 \uc788\uc74c. (\uc774\uac83\uc774 git diff\uc758 \uc6d0\ub9ac.)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\uc815\ub9ac\ud558\uba74 commit = snapshot + metadata(who, when, why)<br>snapshot = tree(folder structure) + blob(file contents\ub97c \uc758\ubbf8)<br>\uac19\uc740 \ub0b4\uc6a9 = \uac19\uc740 hash = \ud558\ub098\ub9cc \uc800\uc7a5 (deduplicate)<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Git Basic Commands<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">git\uc740 \uc544\ub798\uc640 \uac19\uc740 \uae30\ubcf8 \uba85\ub839\uc5b4\ub4e4\uc774 \uc788\ub2e4.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>git init (\uc774 \ud3f4\ub354\ub97c git \uc800\uc7a5\uc18c\ub85c \ub9cc\ub4e4\uc5b4\uc918)<\/li>\n\n\n\n<li>git status (\uc9c0\uae08 \uc0c1\ud0dc\ub294?)<\/li>\n\n\n\n<li>git add (\uc774 \ud30c\uc77c\uc744 commit \uc900\ube44 \ubaa9\ub85d(staging area)\uc5d0 \uc62c\ub824\uc918)<\/li>\n\n\n\n<li>git commit (staging\uc758 \ub0b4\uc6a9\uc744 \uc5ed\uc0ac\uc5d0 \uae30\ub85d\ud574\uc918)<\/li>\n\n\n\n<li>git log (\uc9c0\uae08\uae4c\uc9c0\uc758 commit \uc774\ub825\uc744 \ubcf4\uc5ec\uc918)<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">git init<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">initialization (\ucd08\uae30\ud654)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\ud504\ub85c\uc81d\ud2b8\ub97c \uc2dc\uc791\ud560 \ub54c \ucd5c\ucd08 1\ud68c\ub9cc \uc2e4\ud589.<br>\uc2e4\ud589\ud558\uba74 \ud3f4\ub354 \uc548\uc5d0 .git directory\uac00 \uc0dd\uc131\ub418\uace0, \uadf8 \uc548\uc5d0 git\uc774 \ud544\uc694\ud55c \ubaa8\ub4e0 \uac83\uc744 \uc800\uc7a5\ud568.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>; \ud504\ub85c\uc81d\ud2b8\ub97c \uc9c4\ud589\ud560 Directory \uc0dd\uc131 \ud6c4, \ud574\ub2f9 Directory\ub85c \uc774\ub3d9.\n# mkdir my-project &amp;&amp; cd my-project\n\n; init \uba85\ub839\uc5b4\ub97c \ud1b5\ud558\uc5ec Git \ud504\ub85c\uc81d\ud2b8 \uc2dc\uc791\n# git init\nInitialized empty Git repository in \/root\/my-project\/.git\/\n\n; .git \ud3f4\ub354 \uc0dd\uc131 \ud655\uc778\n# ls -al\ndrwxr-xr-x  7 root root 4096 May 15 15:02 .git<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">.git Directory\uc5d0\ub294 commit history, branch information, configuration \ub4f1 \uc124\uc815\ub4e4\uc774 \ub4e4\uc5b4\uc788\uc74c.<br>\uc774 \ud3f4\ub354\ub97c \uc9c0\uc6b0\uba74 Git \uc774\ub825\uc774 \uc804\ubd80 \uc0ac\ub77c\uc9c0\uae30 \ub54c\ubb38\uc5d0 \uc0ad\uc81c\ud558\uba74 \uc548\ub428.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">git status<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\ud604\uc7ac \uc0c1\ud0dc(Status)\ub97c \ud655\uc778. \uc5b4\ub5a4 \ud30c\uc77c\uc774 \uc218\uc815\ub418\uc5c8\ub294\uc9c0. Staging\uc5d0 \uc62c\ub77c\uc654\ub294\uc9c0, \uc544\uc9c1 \ucd94\uc801\ub418\uc9c0 \uc54a\ub294 \ud30c\uc77c\uc774 \uc788\ub294\uc9c0 \ub4f1.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>; init\ub9cc \ud55c \uc0c1\ud669 (\uc544\uc9c1 git\uc774 \ubaa8\ub974\ub294 \ud30c\uc77c\ub4e4\uc774 \ucd9c\ub825\ub428)\n# git status\nOn branch master\n\nNo commits yet\n\nUntracked files:\n  (use \"git add &lt;file&gt;...\" to include in what will be committed)\n        index.html\n        style.css\n\nnothing added to commit but untracked files present (use \"git add\" to track)\n\n; staging area\ub85c \ud30c\uc77c \uc774\ub3d9 \ud6c4 \uc0c1\ud0dc \ud655\uc778\n# git add index.html\n# git status\nOn branch master\n\nNo commits yet\n\nChanges to be committed:\n  (use \"git rm --cached &lt;file&gt;...\" to unstage)\n        new file:   index.html\n\nUntracked files:\n  (use \"git add &lt;file&gt;...\" to include in what will be committed)\n        style.css<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">git add<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Working Directory -&gt; Staging Area\ub85c \ud30c\uc77c\uc744 \uc62c\ub9bc. \uc5b4\ub5a4 \ud30c\uc77c\uc744 \uc774\ubc88 commit\uc5d0 \ud3ec\ud568\ud560\uc9c0 \uace0\ub974\ub294 \ub2e8\uacc4.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>; \ud30c\uc77c \ud558\ub098\ub9cc\n# git add index.html\n\n; \ud30c\uc77c \uc5ec\ub7ec\uac1c\n# git add index.html style.css\n\n; \ubcc0\uacbd\ub41c \ud30c\uc77c \uc804\ubd80 (\ub9ce\uc774 \uc0ac\uc6a9\ub428)\n# git add .\n\n; \ud2b9\uc815 \ub514\ub809\ud130\ub9ac (\ubaa8\ub4e0 \ud558\uc704 \ud30c\uc77c \ubc0f \ub514\ub809\ud130\ub9ac)\n# git add src\/<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">git commit<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Staging area\uc5d0 \uc62c\ub77c\uc628 \ud30c\uc77c\ub4e4\uc744 \ud558\ub098\uc758 Snapshot\uc73c\ub85c \uc800\uc7a5. -m \uc635\uc158\uc744 \ud1b5\ud574 Message(comment)\ub97c \ubd99\uc5ec\uc57c \ub098\uc911\uc5d0 \uc774 commit\uc774 \ubb54\uc9c0 \uc54c \uc218\uac00 \uc788\uc74c.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>; \uae30\ubcf8 \ucee4\ubc0b\n# git commit -m \"feat: \uba54\uc778 \ud398\uc774\uc9c0 \ucd94\uac00\"\n&#91;master (root-commit) 2a9fef4] feat: \uba54\uc778 \ud398\uc774\uc9c0 \ucd94\uac00\n 2 files changed, 4 insertions(+)\n create mode 100644 index.html\n create mode 100644 style.css\n\n; \uae30\uc874 \ud30c\uc77c \uc218\uc815 \ud6c4, add + commit \ud55c\ubc88\uc5d0 \ud558\uae30\n# git commit -am \"fix: \uba54\uc778 \ud398\uc774\uc9c0 \uc81c\ubaa9 \uc218\uc815\"\n&#91;master a2362d6] fix: \uba54\uc778 \ud398\uc774\uc9c0 \uc81c\ubaa9 \uc218\uc815\n 1 file changed, 1 insertion(+), 1 deletion(-)<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">git log<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">commit \uc774\ub825\uc744 \ucd5c\uc2e0 \uc21c\uc73c\ub85c \ubcf4\uc5ec\uc90c. option\uc5d0 \ub530\ub77c\uc11c \ubcf4\uae30 \ubc29\uc2dd\uc744 \ub2e4\uc591\ud558\uac8c \ubcc0\uacbd \uac00\ub2a5.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>; \uae30\ubcf8 (\uc0c1\uc138\ud558\uac8c)\n# git log\ncommit a2362d63d6eb6c95708eac077193721bacf0be04 (HEAD -&gt; master)\nAuthor: YC &lt;yc@it-blog.kr&gt;\nDate:   Thu May 21 15:43:25 2026 +0900\n\n    fix: \uba54\uc778 \ud398\uc774\uc9c0 \uc81c\ubaa9 \uc218\uc815\n\ncommit 2a9fef44a6d538f0d01b8308bacf1d9e12152a35\nAuthor: YC &lt;yc@it-blog.kr&gt;\nDate:   Thu May 21 15:42:03 2026 +0900\n\n    feat: \uba54\uc778 \ud398\uc774\uc9c0 \ucd94\uac00\n\n; \ud55c\uc904 \uc694\uc57d\n# git log --oneline\na2362d6 (HEAD -&gt; master) fix: \uba54\uc778 \ud398\uc774\uc9c0 \uc81c\ubaa9 \uc218\uc815\n2a9fef4 feat: \uba54\uc778 \ud398\uc774\uc9c0 \ucd94\uac00\n\n; \ucd5c\uadfc 1\uac1c\ub9cc\n# git log --oneline -1\na2362d6 (HEAD -&gt; master) fix: \uba54\uc778 \ud398\uc774\uc9c0 \uc81c\ubaa9 \uc218\uc815<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Test Flow<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>; 1. \ud504\ub85c\uc81d\ud2b8 \uc2dc\uc791\n# mkdir my-project &amp;&amp; cd my-project\n# git init\n\n; 2. \ud30c\uc77c \ub9cc\ub4e4\uae30\n# echo \"&lt;h1&gt;Hello World!&lt;\/h1&gt;\" &gt; index.html\n\n; 3. Staging\uc5d0 \uc62c\ub9ac\uae30\n# git add .\n\n; 4. \uc0c1\ud0dc \ud655\uc778\n# git status\n\n; 5. \ucee4\ubc0b\n# git commit -m \"init: \ud504\ub85c\uc81d\ud2b8 \uc2dc\uc791\"\n\n; 6. \uc774\ub825 \ud655\uc778\n# git log --oneline<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\ub418\ub3cc\ub9ac\uae30<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\uc774\uc804 \ubc84\uc804\uc73c\ub85c \ub418\ub3cc\ub9ac\uace0 \uc2f6\uc744 \ub54c \uc0ac\uc6a9\ud560 \uc218 \uc788\uc74c.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>git diff (\ubb50\uac00 \ubc14\ub00c\uc5c8\ub294\uc9c0 \ubcf4\uc5ec\uc918)<\/li>\n\n\n\n<li>git restore (\ud30c\uc77c\uc744 \uc774\uc804 \uc0c1\ud0dc\ub85c \ub418\ub3cc\ub824\uc918)<\/li>\n\n\n\n<li>git reset (commit\uc744 \ucde8\uc18c\ud574\uc918)<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">git diff<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">commit\ud558\uae30 \uc804\uc5d0 \ub0b4\uac00 \ubb58 \ubc14\uafe8\ub294\uc9c0\ub97c \ud655\uc778\ud560 \ub54c \uc0ac\uc6a9.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>; \uc544\ubb34\uac83\ub3c4 \uc218\uc815\ud558\uc9c0 \uc54a\uc740 \uc0c1\ud669 (\ucd9c\ub825 \uc5c6\uc74c)\n# git diff\n\n; \ud30c\uc77c \uc218\uc815 \ud6c4\n# git diff\ndiff --git a\/index.html b\/index.html\nindex de8b69b..a260fb1 100644\n--- a\/index.html\n+++ b\/index.html\n@@ -1 +1 @@\n-&lt;h1&gt;Hello World!&lt;\/h1&gt;\n+&lt;h1&gt;Hello World!!!&lt;\/h1&gt;\n\n; staging area\uc5d0 \uc62c\ub9b0 \ud6c4 (\uc774\ub54c, git diff\uc758 \ucd9c\ub825\uc740 \uc5c6\uc74c.)\n# git add .\n# git diff --staged\ndiff --git a\/index.html b\/index.html\nindex de8b69b..a260fb1 100644\n--- a\/index.html\n+++ b\/index.html\n@@ -1 +1 @@\n-&lt;h1&gt;Hello World!&lt;\/h1&gt;\n+&lt;h1&gt;Hello World!!!&lt;\/h1&gt;\n\n; \ud2b9\uc815 \ud30c\uc77c\ub9cc\n# git diff --staged index.html\ndiff --git a\/index.html b\/index.html\nindex de8b69b..a260fb1 100644\n--- a\/index.html\n+++ b\/index.html\n@@ -1 +1 @@\n-&lt;h1&gt;Hello World!&lt;\/h1&gt;\n+&lt;h1&gt;Hello World!!!&lt;\/h1&gt;\n\n; \ub450 commit \uc0ac\uc774 \ube44\uad50\n# git diff 95778b6 12d7642\ndiff --git a\/index.html b\/index.html\nindex de8b69b..a260fb1 100644\n--- a\/index.html\n+++ b\/index.html\n@@ -1 +1 @@\n-&lt;h1&gt;Hello World!&lt;\/h1&gt;\n+&lt;h1&gt;Hello World!!!&lt;\/h1&gt;<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">git restore<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">commit\ud558\uae30 \uc804\uc758 \ubcc0\uacbd\uc0ac\ud56d\uc744 \ucde8\uc18c\ud560 \ub54c \uc0ac\uc6a9.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\ub450\uac00\uc9c0 \uc6a9\ub3c4\uac00 \uc788\uc74c.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\uc218\uc815\ud55c \ud30c\uc77c \ub418\ub3cc\ub9ac\uae30 (add \uc804, Working dir \ubcc0\uacbd \ucde8\uc18c)<\/li>\n\n\n\n<li>Staging \ucde8\uc18c\ud558\uae30 (add \ud588\ub294\ub370 \ube7c\uace0 \uc2f6\uc744 \ub54c)<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">git reset<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\uc774\ubbf8 commit\ud55c \uac83\uc744 \uc5c6\uc560\uace0 \uc2f6\uc744 \ub54c \uc0ac\uc6a9.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\uc635\uc158\uc5d0 \ub530\ub77c\uc11c \ud30c\uc77c \ub0b4\uc6a9\uc744 \ubcf4\uc874\ud560\uc9c0 \ub9d0\uc9c0\uac00 \uac08\ub9bc.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img decoding=\"async\" width=\"1024\" height=\"584\" loading=\"lazy\" src=\"https:\/\/it-blog.kr\/wp-content\/uploads\/2026\/05\/image-25-1024x584.png\" alt=\"\" class=\"wp-image-247\" style=\"width:686px;height:auto\" srcset=\"https:\/\/it-blog.kr\/wp-content\/uploads\/2026\/05\/image-25-1024x584.png 1024w, https:\/\/it-blog.kr\/wp-content\/uploads\/2026\/05\/image-25-300x171.png 300w, https:\/\/it-blog.kr\/wp-content\/uploads\/2026\/05\/image-25-768x438.png 768w, https:\/\/it-blog.kr\/wp-content\/uploads\/2026\/05\/image-25.png 1158w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">.gitignore<\/h2>\n\n\n\n<h2 class=\"wp-block-heading\">\ub354 \uc54c\uc544\ubcfc\uac83<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>snapshot<\/li>\n\n\n\n<li>metadata<\/li>\n\n\n\n<li>mtime<\/li>\n\n\n\n<li>inode<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Source code\uc758 \ubcc0\uacbd \uc774\ub825\uc744 \ucd94\uc801\ud558\uace0, \uc5ec\ub7ec \uac1c\ubc1c\uc790\uac00 \ud611\uc5c5\ud560 \uc218 \uc788\ub3c4\ub85d \uc9c0\uc6d0\ud558\ub294 \ubd84\uc0b0 \ubc84\uc804 \uad00\ub9ac \uc2dc\uc2a4\ud15c. Git \ud544\uc694 \uc774\uc720 \uc544\ub798\uc640 \uac19\uc740 \uc0c1\ud669\uc744 \uacbd\ud5d8\ud55c \uc801 \uc788\uc744 \uac83\uc774\ub2e4. \uac1c\ubc1c\uc744 \ud558\ub2e4 \ubcf4\uba74 \uc704\uc640 \uac19\uc740&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-65","post","type-post","status-publish","format-standard","hentry","category-study"],"_links":{"self":[{"href":"https:\/\/it-blog.kr\/index.php?rest_route=\/wp\/v2\/posts\/65","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/it-blog.kr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/it-blog.kr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/it-blog.kr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/it-blog.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=65"}],"version-history":[{"count":23,"href":"https:\/\/it-blog.kr\/index.php?rest_route=\/wp\/v2\/posts\/65\/revisions"}],"predecessor-version":[{"id":248,"href":"https:\/\/it-blog.kr\/index.php?rest_route=\/wp\/v2\/posts\/65\/revisions\/248"}],"wp:attachment":[{"href":"https:\/\/it-blog.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=65"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/it-blog.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=65"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/it-blog.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=65"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}