{"id":766,"date":"2022-10-26T09:43:08","date_gmt":"2022-10-26T00:43:08","guid":{"rendered":"https:\/\/java.ihavenomoney.co.kr\/?page_id=766"},"modified":"2022-10-30T18:17:10","modified_gmt":"2022-10-30T09:17:10","slug":"git-%ec%9d%bc%eb%b0%98-%ec%9d%b4%eb%a1%a0","status":"publish","type":"page","link":"https:\/\/java.ihavenomoney.co.kr\/?page_id=766","title":{"rendered":"Git \uc77c\ubc18 \uc774\ub860"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\">Remark : \uc5c5\ub85c\ub4dc\uc5d0 \uad00\ud55c \uc0c1\uc2dd\uc801\uc778  Git \uc774\ub860\uc744 \uc54c\uc544\ubcf4\uc790<\/h3>\n\n\n\n<ul class=\"wp-block-list\"><li>2005 \ub144 \ub9ac\ub205\uc2a4\ub97c \uae30\ubc18\uc73c\ub85c \ub9cc\ub4e0 \uc18c\uc2a4<\/li><li>\uba85\ub839\uc5b4 \uc5b8\uc5b4\ub294  \ub9ac\ub205\uc2a4 bash  <\/li><li>MS \uc0ac\uc5d0\uc11c\ub3c4 Git \ubc29\uc2dd\uc744 \ucc44\ud0dd\ud568.<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"457\" height=\"961\" src=\"https:\/\/java.ihavenomoney.co.kr\/wp-content\/uploads\/2022\/10\/Git_digram_ver02.png\" alt=\"\" class=\"wp-image-771\" srcset=\"https:\/\/java.ihavenomoney.co.kr\/wp-content\/uploads\/2022\/10\/Git_digram_ver02.png 457w, https:\/\/java.ihavenomoney.co.kr\/wp-content\/uploads\/2022\/10\/Git_digram_ver02-143x300.png 143w\" sizes=\"auto, (max-width: 457px) 100vw, 457px\" \/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\">\ud68c\uc0ac\uc5d0\uc11c \uc4f0\ub294 \uc18c\uc2a4 \uc800\uc7a5 \ud074\ub77c\uc6b0\ub4dc\uac00 \uc788\uc73c\uba74 \ub530\ub85c \uc11c\ubc84 \uc138\ud305\uc740 \uc0dd\ub7b5 \ud574\ub3c4 \ub41c\ub2e4<\/h4>\n\n\n\n<h3 class=\"wp-block-heading\">1. \ub85c\uceec \ucef4 \ubc84\uc804\uc5d0 \ub9de\uac8c Git \ud504\ub85c\uadf8\ub7a8 \uc124\uce58 <\/h3>\n\n\n\n<p><a href=\"https:\/\/git-scm.com\/download\/win\">https:\/\/git-scm.com\/download\/win<\/a><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"965\" height=\"592\" src=\"https:\/\/java.ihavenomoney.co.kr\/wp-content\/uploads\/2022\/10\/image-6.png\" alt=\"\" class=\"wp-image-797\" srcset=\"https:\/\/java.ihavenomoney.co.kr\/wp-content\/uploads\/2022\/10\/image-6.png 965w, https:\/\/java.ihavenomoney.co.kr\/wp-content\/uploads\/2022\/10\/image-6-300x184.png 300w, https:\/\/java.ihavenomoney.co.kr\/wp-content\/uploads\/2022\/10\/image-6-768x471.png 768w\" sizes=\"auto, (max-width: 965px) 100vw, 965px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">default \ub85c Next \ub85c \uc124\uce58 \ud558\uba74 \ub41c\ub2e4.<\/h3>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"515\" height=\"397\" src=\"https:\/\/java.ihavenomoney.co.kr\/wp-content\/uploads\/2022\/10\/image-7.png\" alt=\"\" class=\"wp-image-807\" srcset=\"https:\/\/java.ihavenomoney.co.kr\/wp-content\/uploads\/2022\/10\/image-7.png 515w, https:\/\/java.ihavenomoney.co.kr\/wp-content\/uploads\/2022\/10\/image-7-300x231.png 300w\" sizes=\"auto, (max-width: 515px) 100vw, 515px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"513\" height=\"398\" src=\"https:\/\/java.ihavenomoney.co.kr\/wp-content\/uploads\/2022\/10\/image-8.png\" alt=\"\" class=\"wp-image-809\" srcset=\"https:\/\/java.ihavenomoney.co.kr\/wp-content\/uploads\/2022\/10\/image-8.png 513w, https:\/\/java.ihavenomoney.co.kr\/wp-content\/uploads\/2022\/10\/image-8-300x233.png 300w\" sizes=\"auto, (max-width: 513px) 100vw, 513px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">2. \uc11c\ubc84\uc5d0 Git \uc124\uce58 <\/h3>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:java decode:true \" >sudo apt install git -y<\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">3. \uc11c\ubc84\uc5d0  \ud3f4\ub354 \uc0dd\uc131 \ubc0f \uc0ac\uc6a9\uc790 \uc0dd\uc131<\/h3>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:vim decode:true \" >$ sudo mkdir \/data\/git\n\n$ sudo useradd -c gituser_test -d \/data\/git\/ -p mypasswd gituser\n\n#\ud328\uc2a4\uc6cc\ub4dc \uc124\uc815 \n$ sudo passwd gituser\nNew password:\nRetype new password:\npasswd: password updated successfully\n\n#\ud655\uc778 \n$cat \/ect\/passwd\nroot:x:0:0:root:\/root:\/bin\/bash\n ::: \uc911\uac04 \uc0dd\ub7b5 :::\ngituser:x:1002:1002:gituser_test:\/data\/git\/:\/bin\/bash\n<\/pre><\/div>\n\n\n\n<h4 class=\"has-vivid-red-color has-text-color wp-block-heading\">*\ud14c\uc2a4\ud2b8\ub97c \uc704\ud574 \/bin\/bash \ub85c \ud558\uc600\uc73c\ub098 ssh \ub85c \uc804\uccb4\ud30c\uc77c \uc811\uadfc \uac00\ub2a5\ud558\uc5ec \ubcf4\uc548\uc0c1 \uc704\ud5d8(SSH \uacf5\uac1c\ud0a4\ub85c \uc811\uadfc, only git-shell ) \ucd94\ucc9c <br>\ucc38\uc870 :https:\/\/git-scm.com\/docs\/git-shell<\/h4>\n\n\n\n<h3 class=\"wp-block-heading\">4. \uc11c\ubc84 \ud3f4\ub354 \uc0ac\uc6a9\uad8c\ud55c \uc124\uc815<\/h3>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:java decode:true \" >$ sudo chown -R gituser:gituser \/data\/git\n$ sudo chmod -R 755 \/data\/git<\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">5. \uc11c\ubc84 master \ud3f4\ub354 html \uc124\uc815<\/h3>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:vim decode:true \" >$sudo su gituser\n\ngit$ git init --bare html\n\nhint: Using 'master' as the name for the initial branch. This default branch name\nhint: is subject to change. To configure the initial branch name to use in all\nhint: of your new repositories, which will suppress this warning, call:\nhint:\nhint:   git config --global init.defaultBranch &lt;name&gt;\nhint:\nhint: Names commonly chosen instead of 'master' are 'main', 'trunk' and\nhint: 'development'. The just-created branch can be renamed via this command:\nhint:\nhint:   git branch -m &lt;name&gt;\nInitialized empty Git repository in \/data\/git\/html\/\n\ngituser@localhost:\/data\/git$ ls\nhtml<\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">6. \ub85c\uceec \ucef4\uc5d0\uc11c \uc5ec\uae34\uc120 Git Bash \uc120\ud0dd \/ \uba85\ub839\uc5b4\ub97c \uc54c\uc544\ubcf4\ub824\uace0 bash \ub85c \uc2e4\ud589 \ud569\ub2c8\ub2e4.<\/h3>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"262\" height=\"525\" src=\"https:\/\/java.ihavenomoney.co.kr\/wp-content\/uploads\/2022\/10\/image-9.png\" alt=\"\" class=\"wp-image-810\" srcset=\"https:\/\/java.ihavenomoney.co.kr\/wp-content\/uploads\/2022\/10\/image-9.png 262w, https:\/\/java.ihavenomoney.co.kr\/wp-content\/uploads\/2022\/10\/image-9-150x300.png 150w\" sizes=\"auto, (max-width: 262px) 100vw, 262px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">7. \ub85c\uceec \ucef4\uc5d0\uc11c bash \ucc3d\uc5d0\uc11c \uc62c\ub9ac \uc18c\uc2a4\uac00 \uc788\uc740  \uacbd\ub85c\ub85c \uc774\ub3d9<br>7.1 \ucd08\uae30\ud654 init <br>7.2 \ubaa8\ub4e0\ud30c\uc77c\ucd94\uac00 add .<br>7.3 \ucee4\ubbf8\ud2b8(\uc801\uc6a9) \uc5d0 \uc124\uba85\ucd94\uac00 commit<br>7.4 \uc81c\uc791\uc790 \uc815\ubcf4 \uc5c6\ub2e4\ub294 \uc5d0\ub7ec \ubc1c\uc0dd (\ub098\uc628\ub300\ub85c \ucd94\uac00\ud574\uc11c \ub2e4\uc2dc \ud568)<\/h3>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:vim decode:true \" >virtual01@PC MINGW64 ~\n\n$ cd E:\\html\n\n$ git init\nInitialized empty Git repository in E:\/html\/.git\/\n\n$ git add .\n\n$ git commit -m \"first upload\"\nAuthor identity unknown\n\n*** Please tell me who you are.\n\nRun\n\n  git config --global user.email \"you@example.com\"\n  git config --global user.name \"Your Name\"\n\nto set your account's default identity.\nOmit --global to set the identity only in this repository.\n\nfatal: unable to auto-detect email address (got 'virtual01@hPC.(none)')<\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">8. \ub85c\uceec \ucef4 \uc18c\uc2a4 \uacbd\ub85c\uc5d0 \uc81c\uc791\uc790 \uc815\ubcf4 \ub123\uace0 \ub2e4\uc2dc commit <\/h3>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:vim decode:true \" >$ git config --global user.email \"you@example.com\"\n$ git config --global user.name \"Honggildong\"\n\n$ git commit -m \"first upload\"<\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">9. \ub85c\uceec\ucef4\uc5d0\uc11c \uc11c\ubc84\ub85c \uc5f0\uacb0 \ubc0f commit \ub41c\uac70 \uc804\uc1a1<\/h3>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:vim decode:true \" >$ git remote add origin ssh:\/\/gituser@111.222.222.111\/data\/git\/html\n\n# \uc218\uc815\uc740 \n$ git remote set-url origin ssh:\/\/gituser@111.222.222.111\/data\/git\/html<\/pre><\/div>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:vim decode:true \" >$ git push origin master\ngituser@111.222.222.111's password:\nEnumerating objects: 1588, done.\nCounting objects: 100% (1588\/1588), done.\nDelta compression using up to 2 threads\nCompressing objects: 100% (1568\/1568), done.\nWriting objects: 100% (1588\/1588), 32.72 MiB | 7.23 MiB\/s, done.\nTotal 1588 (delta 376), reused 0 (delta 0), pack-reused 0\nremote: Resolving deltas: 100% (376\/376), done.\nTo ssh:\/\/111.222.222.111\/data\/git\/html\n * [new branch]      master -&gt; master\n<\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">10. \ub85c\uceec \ucef4\uc5d0\uc11c \ub85c\uadf8 \ud655\uc778 <\/h3>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:vim decode:true \" >$ git log\ncommit 696b1f683190a1e963c47bcee6f13b6c5ec44377 (HEAD -&gt; master, origin\/master)\nAuthor: Honggildong &lt;you@example.com&gt;\nDate:   Sun Oct 30 17:36:13 2022 +0900\n\n    first upload\n<\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">11.  \uc11c\ubc84 \uc5d0\uc11c \ub85c\uadf8 \ud655\uc778 (\ub85c\uceec \ucef4\uacfc \uac19\uc740 \ub0b4\uc6a9\uc774 \ud655\uc778\ub428)<\/h3>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:vim decode:true \" >gituser@localhost:\/data\/git$ git log\ncommit 696b1f683190a1e963c47bcee6f13b6c5ec44377 (HEAD -&gt; master)\nAuthor: Honggildong &lt;you@example.com&gt;\nDate:   Sun Oct 30 17:36:13 2022 +0900\n\n    first upload\n<\/pre><\/div>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Remark : \uc5c5\ub85c\ub4dc\uc5d0 \uad00\ud55c \uc0c1\uc2dd\uc801\uc778 Git \uc774\ub860\uc744 \uc54c\uc544\ubcf4\uc790 2005 \ub144 \ub9ac\ub205\uc2a4\ub97c \uae30\ubc18\uc73c\ub85c \ub9cc\ub4e0 \uc18c\uc2a4 \uba85\ub839\uc5b4 \uc5b8\uc5b4\ub294 \ub9ac\ub205\uc2a4 bash MS \uc0ac\uc5d0\uc11c\ub3c4 Git \ubc29\uc2dd\uc744 \ucc44\ud0dd\ud568. \ud68c\uc0ac\uc5d0\uc11c \uc4f0\ub294 \uc18c\uc2a4 \uc800\uc7a5 \ud074\ub77c\uc6b0\ub4dc\uac00 \uc788\uc73c\uba74 \ub530\ub85c \uc11c\ubc84 \uc138\ud305\uc740 \uc0dd\ub7b5 \ud574\ub3c4 \ub41c\ub2e4 1. \ub85c\uceec \ucef4 \ubc84\uc804\uc5d0 \ub9de\uac8c Git \ud504\ub85c\uadf8\ub7a8 \uc124\uce58 https:\/\/git-scm.com\/download\/win default \ub85c Next \ub85c \uc124\uce58 \ud558\uba74 \ub41c\ub2e4. 2. \uc11c\ubc84\uc5d0 Git \uc124\uce58 &hellip;<br \/><a href=\"https:\/\/java.ihavenomoney.co.kr\/?page_id=766\" class=\"more-link pen_button pen_element_default pen_icon_arrow_double\"><span class=\"screen-reader-text\">Git \uc77c\ubc18 \uc774\ub860<\/span> \ub354\ubcf4\uae30<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-766","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/java.ihavenomoney.co.kr\/index.php?rest_route=\/wp\/v2\/pages\/766","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/java.ihavenomoney.co.kr\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/java.ihavenomoney.co.kr\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/java.ihavenomoney.co.kr\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/java.ihavenomoney.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=766"}],"version-history":[{"count":16,"href":"https:\/\/java.ihavenomoney.co.kr\/index.php?rest_route=\/wp\/v2\/pages\/766\/revisions"}],"predecessor-version":[{"id":818,"href":"https:\/\/java.ihavenomoney.co.kr\/index.php?rest_route=\/wp\/v2\/pages\/766\/revisions\/818"}],"wp:attachment":[{"href":"https:\/\/java.ihavenomoney.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=766"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}