{"id":853,"date":"2019-01-25T02:26:58","date_gmt":"2019-01-24T17:26:58","guid":{"rendered":"http:\/\/141.164.34.82\/?p=853"},"modified":"2022-02-03T17:30:45","modified_gmt":"2022-02-03T08:30:45","slug":"git-short-introduction","status":"publish","type":"post","link":"http:\/\/ds.sumeun.org\/?p=853","title":{"rendered":"\uae43(git)"},"content":{"rendered":"<h1>\uae43(git), \uc9e7\uc740 \uc18c\uac1c<\/h1>\n<ul>\n<li>git\uc740 \uc624\ud508\uc18c\uc2a4 \ubd84\uc0b0 \ubc84\uc804 \uad00\ub9ac \uc2dc\uc2a4\ud15c\uc774\ub2e4.[<sup>1]<\/sup><\/li>\n<li>git\uc740 \uc18c\uc2a4 \ucf54\ub4dc\uc758 \uc774\ub825\uc744 \uad00\ub9ac\ud55c\ub2e4.\n<ul>\n<li>\uc774\ub825 \uad00\ub9ac\ub780 \ucf54\ub4dc\uac00 \ubcc0\ud558\ub294 \uacfc\uc815\uc744 \uc800\uc7a5\ud558\ub294 \uac83\uc73c\ub85c \uc0dd\uac01\ud560 \uc218 \uc788\ub2e4.<\/li>\n<li>\uc18c\uc2a4\uc5d0\uc11c \uc774\ub825 \uad00\ub9ac\uac00 \uc911\uc694\ud55c \uac83\uc740 \uac1c\ubc1c\ud558\ub294 \uacfc\uc815\uc5d0\uc11c \uc798 \ub418\ub358 \uac83\ub3c4 \uc548 \ub418\ub294 \uc218\ub3c4 \uc788\uae30 \ub54c\ubb38\uc5d0 \uc11c\ub85c \ube44\uad50\ud558\uace0, \uc798\ubabb\ub418\uc5c8\ub2e4\uace0 \ub290\ub07c\uba74 \uc608\uc804 \uc18c\uc2a4\ub85c \ub418\ub3cc\uc544\uac08 \uc218 \uc788\uc5b4\uc57c \ud558\uae30 \ub54c\ubb38\uc774\ub2e4.<\/li>\n<\/ul>\n<\/li>\n<li>git\uc740 \uc5ec\ub7ec \uc0ac\ub78c\uc774 \ud611\ub825\ud574\uc11c \uac1c\ubc1c\ud560 \uc218 \uc788\ub3c4\ub85d \ub3c4\uc640\uc900\ub2e4.\n<ul>\n<li>\ub9cc\uc57d \uc5ec\ub7ec \uc0ac\ub78c\uc774 \ud568\uaed8 \ud504\ub85c\uadf8\ub7a8\uc744 \uc9e0\ub2e4\uba74 \ud504\ub85c\uadf8\ub798\uba38 A\uac00 \uc218\uc815\ud55c \ubd80\ubd84\uc744 \ud504\ub85c\uadf8\ub798\uba38 B\uac00 \uc218\uc815\ud560 \uc218\ub3c4 \uc788\uace0, \ud504\ub85c\uadf8\ub798\uba38 B\uac00 \ubc14\uafb8\uba74 \uc548 \ub41c\ub2e4\uace0 \uc0dd\uac01\ud55c \ubd80\ubd84\uc744 \ud504\ub85c\uadf8\ub798\uba38 A\uac00 \ubc14\uafc0 \uc218\ub3c4 \uc788\ub2e4.<\/li>\n<li>\ub204\uac00, \uc5b8\uc81c, \ubb34\uc5c7\uc744, \uc65c \uc218\uc815\ud588\ub294\uc9c0\ub97c \uba85\ud655\ud788 \ud560 \ud544\uc694\uac00 \uc788\ub2e4.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h2>\uc124\uce58<\/h2>\n<ul>\n<li>Ubuntu \ub4f1 \ub370\ube44\uc548 \uacc4\uc5f4 : <code>sudo apt install git-all<\/code><\/li>\n<li>Fedora : <code>sudo dnf install git-all<\/code><\/li>\n<li>\ucc38\uace0 : <a href=\"https:\/\/git-scm.com\/book\/ko\/v2\/%EC%8B%9C%EC%9E%91%ED%95%98%EA%B8%B0-Git-%EC%84%A4%EC%B9%98\">https:\/\/git-scm.com\/book\/ko\/v2\/\uc2dc\uc791\ud558\uae30-Git-\uc124\uce58<\/a><\/li>\n<\/ul>\n<h2>\uc8fc\uc694 \uba85\ub839\uc5b4<\/h2>\n<ul>\n<li><code>git init .<\/code> : \ucd08\uae30\ud654<\/li>\n<li><code>git add -A .<\/code>\/<code>git commit<\/code> : \ucee4\ubc0b \uc900\ube44\/\ucee4\ubc0b<\/li>\n<li><code>git status<\/code> : \ud604\uc7ac \uc0c1\ud0dc<\/li>\n<li><code>git log<\/code> : \uc774\ub825(\ucee4\ubc0b\ub0b4\uc6a9)<\/li>\n<li><code>git diff<\/code> : \ucc28\uc774 \ud655\uc778<\/li>\n<li><code>git checkout<\/code> : \uc774\uc804 \ud654\uc77c \ub0b4\uc6a9 \ud655\uc778<\/li>\n<li><code>git config --global user.name \"...\"<\/code> \/ <code>git config --local user.name \"...\"<\/code> : git id \uc124\uc815(global\/local)<\/li>\n<li><code>git config --list<\/code> : git \uc124\uc815 \ud655\uc778<\/li>\n<li><code>git config credential.helper store<\/code> : git user.name, password \uc800\uc7a5, <a href=\"https:\/\/stackoverflow.com\/questions\/35942754\/how-to-save-username-and-password-in-git\">\ucc38\uace0<\/a><\/li>\n<li><code>git blame<\/code> : \ud604\uc7ac \uc18c\uc2a4\uc758 \ucd5c\uc885 \uc791\uc131\uc790 \ud655\uc778<\/li>\n<\/ul>\n<h2>\uc77c\ubc18\uc801\uc778 \uc791\uc5c5 \uc21c\uc11c<\/h2>\n<ul>\n<li>(\uc120\ud0dd\uc0ac\ud56d) \ud574\ub2f9 \ud3f4\ub354\uc5d0 \ub300\ud574 id \uc124\uc815(\ubaa8\ub4e0 \ud3f4\ub354\uc5d0 \ub300\ud574 id \uc124\uc815\uc740 <code>local<\/code> -&gt; <code>global<\/code>\ub85c \uc218\uc815\ud55c\ub2e4.)<\/li>\n<\/ul>\n<pre>git config --local user.name &lt;...&gt;\r\n<\/pre>\n<ul>\n<li>\uc791\uc5c5\uc744 \ud560 \ud3f4\ub354(\ub514\ub809\ud1a0\ub9ac)\ub85c \uac00\uc11c \ucd08\uae30\ud654\ud55c\ub2e4.<\/li>\n<\/ul>\n<pre>git init .\r\n<\/pre>\n<ul>\n<li>\uc791\uc5c5\uc744 \ud55c\ub2e4(\ud654\uc77c\uc774 \uc0dd\uc131\ub41c\ub2e4).<\/li>\n<li>\uc791\uc5c5 \ub0b4\uc6a9\uc744 \ubaa8\ub450 \ucee4\ubc0b\ud55c\ub2e4(\uc774\ub825 \uad00\ub9ac\ub97c \uc704\ud574 \uc800\uc7a5\ud55c\ub2e4).<\/li>\n<\/ul>\n<pre>git add -A . # &lt;-&gt; git rm\r\ngit commit -m \"blah-blah\"\r\n<\/pre>\n<ul>\n<li>\uc791\uc5c5, <code>add<\/code>, <code>commit<\/code>\uc744 \ubc18\ubcf5\ud55c\ub2e4.<\/li>\n<li>\uc774\ub825\uc744 \ud655\uc778\ud558\ub294 \ubc29\ubc95\ub4e4\n<ul>\n<li><code>git log<\/code> : \ucee4\ubc0b \ub85c\uadf8<\/li>\n<li><code>git blame<\/code> : \ud604\uc7ac \uc18c\uc2a4\uc758 \ucd5c\uc885 \uc791\uc131\uc790 \ud655\uc778<\/li>\n<li><code>git checkout<\/code> : \uc774\uc804 \ud654\uc77c \ub0b4\uc6a9 \ud655\uc778<\/li>\n<li><code>git status<\/code> : \ud604\uc7ac \uc0c1\ud0dc \ud655\uc778. \ub9c8\uc9c0\ub9c9 \ucee4\ubc0b \uc774\ud6c4 \uc218\uc815\ub41c \uc0ac\ud56d \ub4f1.<\/li>\n<\/ul>\n<\/li>\n<li>\ub9c8\uc9c0\ub9c9 \ucee4\ubc0b\uc744 \ubcf5\uc6d0\ud558\uae30(\ub54c\ub54c\ub85c \ud544\uc694\ud558\ub2e4.)\n<pre>git reset --hard HEAD  \r\ngit clean -fd  # \uc774\ub825\uad00\ub9ac\ub97c \ud558\uc9c0 \uc54a\ub294 \ud30c\uc77c\uc740 \ubaa8\ub450 \uc9c0\uc6b4\ub2e4. \uc9c0\uc6b4 \ud6c4 \ud734\uc9c0\ud1b5\uc5d0\uc11c \ubcf5\uad6c\ud560 \uc218 \uc5c6\ub2e4. \r\ngit clean -fdx # \uc774\ub825\uad00\ub9ac \ud558\uc9c0 \uc54a\ub294 \ud30c\uc77c\uacfc .gitignore\uc5d0\uc11c \uc9c0\uc815\ub41c \ud654\uc77c\uc744 \ubaa8\ub450 \uc9c0\uc6b4\ub2e4. \r\n<\/pre>\n<\/li>\n<li>\ub300\uc6a9\ub7c9\uc758 \ud654\uc77c\uc5d0 \ub300\ud574 \uc774\ub825\uc744 \uc791\uc131\ud558\uace0 \uad00\ub9ac\ud558\uba70 \ubd80\ub2f4\uc774 \ucee4\uc9c4\ub2e4. <a href=\"https:\/\/stackoverflow.com\/questions\/1143796\/remove-a-file-from-a-git-repository-without-deleting-it-from-the-local-filesyste\">\uc2e4\uc218\ub85c \uc774\ub825 \uad00\ub9ac\uc5d0 \ud3ec\ud568\ub41c \ud654\uc77c\uc744 \uc9c0\uc6b0\ub824\uba74(\ud558\uc9c0\ub9cc \ub85c\uceec \ud654\uc77c\uc740 \ubcf4\uc874\ud558\ub824\uba74)<\/a><\/li>\n<\/ul>\n<pre>git rm --cached filename.ext\r\ngir rm --cached -r directory\r\n<\/pre>\n<ul>\n<li><a href=\"https:\/\/stackoverflow.com\/questions\/2016901\/viewing-unpushed-git-commits\">\ub85c\uceec\uc758 commit \uc911 \uc544\uc9c1 push\ub418\uc9c0 \uc54a\uc740 \ub0b4\uc6a9\uc744 \ud655\uc778\ud558\ub824\uba74<\/a><\/li>\n<\/ul>\n<pre>git log origin\/master..HEAD\r\ngit diff origin\/master..HEAD\r\n<\/pre>\n<ul>\n<li><a href=\"https:\/\/stackoverflow.com\/questions\/9848347\/can-i-make-git-diff-only-show-the-changed-file-names-and-line-numbers\">\ub85c\uceec\uc758 commit \uc911 \uc544\uc9c1 push\ub418\uc9c0 \uc54a\uc740 <strong>\ud654\uc77c\uc774\ub984\ub9cc<\/strong> \ud655\uc778\ud558\ub824\uba74<\/a><\/li>\n<\/ul>\n<pre>git diff origin\/master..HEAD --name-only\r\n<\/pre>\n<ul>\n<li><a href=\"https:\/\/git-scm.com\/book\/ko\/v2\/Git-%EB%8F%84%EA%B5%AC-Reset-%EB%AA%85%ED%99%95%ED%9E%88-%EC%95%8C%EA%B3%A0-%EA%B0%80%EA%B8%B0\">HEAD<\/a>\uc758 \uc758\ubbf8 : HEAD\ub294 \ud604\uc7ac \ube0c\ub79c\uce58\ub97c \uac00\ub9ac\ud0a4\ub294 \ud3ec\uc778\ud130\uc774\uba70, \ube0c\ub79c\uce58\ub294 \ube0c\ub79c\uce58\uc5d0 \ub2f4\uae34 \ucee4\ubc0b \uc911 \uac00\uc7a5 \ub9c8\uc9c0\ub9c9 \ucee4\ubc0b\uc744 \uac00\ub9ac\ud0a8\ub2e4. \uc9c0\uae08\uc758 HEAD\uac00 \uac00\ub9ac\ud0a4\ub294 \ucee4\ubc0b\uc740 \ubc14\ub85c \ub2e4\uc74c \ucee4\ubc0b\uc758 \ubd80\ubaa8\uac00 \ub41c\ub2e4. \ub2e8\uc21c\ud558\uac8c \uc0dd\uac01\ud558\uba74 HEAD\ub294 \ud604\uc7ac \ube0c\ub79c\uce58 \ub9c8\uc9c0\ub9c9 \ucee4\ubc0b\uc758 \uc2a4\ub0c5\uc0f7\uc774\ub2e4.<\/li>\n<\/ul>\n<hr \/>\n<h2>\ucda9\ub3cc \ucc98\ub9ac<\/h2>\n<h3><code>git push<\/code>\uac00 \uc2e4\ud328\ud560 \uacbd\uc6b0, <code>git pull<\/code>\uc744 \uc2e4\ud589\ud55c\ub2e4. <code>git pull<\/code>\ub3c4 \ucda9\ub3cc\uc774 \ubc1c\uc0dd\ud560 \uacbd\uc6b0<\/h3>\n<ol>\n<li>\ucda9\ub3cc\uc774 \uc77c\uc5b4\ub098\uba74 \ub2e4\uc74c\uacfc \uac19\uc740 \uba54\uc138\uc9c0\uac00 \ucd9c\ub825\ub41c\ub2e4.<br \/>\n<code><br \/>\nAuto-merging &lt;filename.txt&gt;<br \/>\nCONFLICT (content): Merge conflict in &lt;filename.txt&gt;<br \/>\nAutomatic merge failed; fix conflicts and then commit the result.<br \/>\n<\/code><\/li>\n<li>\ucda9\ub3cc\uc774 \uc77c\uc5b4\ub09c \ud654\uc77c\uc744 \uc218\uc815\ud55c\ub2e4.<\/li>\n<li>\ub2e4\uc74c\uc744 \uc2e4\ud589\ud55c\ub2e4.\n<pre>git add \r\ngit commit\r\ngit pull\r\n<\/pre>\n<\/li>\n<\/ol>\n<p><a href=\"https:\/\/backlog.com\/git-tutorial\/kr\/intro\/intro5_1.html\">\ucc38\uc870<\/a><\/p>\n<h3><code>git pull<\/code>\uc5d0\uc11c \ubc1c\uc0dd\ud560 \uc218 \uc788\ub294 \ub2e4\ub978 \ubb38\uc81c<\/h3>\n<ol>\n<li>\ub2e4\uc74c\uc758 \uba54\uc138\uc9c0 \ubc1c\uc0dd\ud560 \ub54c,\n<pre>error: unable to resolve reference refs\/remotes\/origin\/...\r\n<\/pre>\n<\/li>\n<li>\ub2e4\uc74c\uc744 \uc2e4\ud589\ud55c\ub2e4.\n<pre>git gc --prune=now\r\ngit remote prune origin\r\n<\/pre>\n<p><a href=\"https:\/\/stackoverflow.com\/questions\/2998832\/git-pull-fails-unable-to-resolve-reference-unable-to-update-local-ref\">\ucc38\uace0: stackoverflow<\/a><\/li>\n<\/ol>\n<h3><code>git merge<\/code>\uc5d0\uc11c \ucda9\ub3cc\uc774 \ubc1c\uc0dd\ud560 \uacbd\uc6b0<\/h3>\n<ul>\n<li><code>git pull<\/code>\uc758 \ucda9\ub3cc\uacfc \ub3d9\uc77c\ud558\uac8c \ucc98\ub9ac\ud55c\ub2e4. <code>git pull<\/code> = <code>git fetch<\/code> + <code>git merge<\/code><\/li>\n<li><code>git fetch<\/code>\ub97c \ud558\uba74 <code>git checkout FETCH_HEAD<\/code>\ub85c \uccb4\ud06c\uc544\uc6c3\ud560 \uc218 \uc788\ub2e4.<\/li>\n<\/ul>\n<h3><code>git rebase<\/code>\uc5d0\uc11c \ucda9\ub3cc\uc774 \ubc1c\uc0dd\ud560 \uacbd\uc6b0<\/h3>\n<ul>\n<li>\ucda9\ub3cc\uc744 \ud574\uacb0 \ud55c \ud6c4\n<pre>git add\r\ngit rebase --continue\r\n<\/pre>\n<\/li>\n<li><code>git rebase<\/code>\ub97c \ucde8\uc18c\ud560 \uacbd\uc6b0: <code>git rebase --abort<\/code><\/li>\n<\/ul>\n<hr \/>\n<h2>\ube0c\ub79c\uce58 \uad00\ub9ac<\/h2>\n<h3>\uc0c8\ub85c\uc6b4 \ube0c\ub79c\uce58 \ub9cc\ub4e4\uae30<\/h3>\n<pre>git checkout -b &lt;BRANCH_NAME&gt;\r\n<\/pre>\n<h3>\uc6d0\uaca9 \uc800\uc7a5\uc18c(remote repository) <code>origin<\/code> \uc5d0 \uc0c8\ub85c\uc6b4 \uc774\ub984\uc73c\ub85c PUSH\ud558\uae30<\/h3>\n<pre>git push -u origin &lt;BRANCH_NAME&gt;\r\n<\/pre>\n<h3>\uc6d0\uaca9 \uc800\uc7a5\uc18c\uc758 \ube0c\ub79c\uce58 \ubd88\ub7ec\uc624\uae30<\/h3>\n<pre>git checkout --track origin\/&lt;BRANCH_NAME&gt;\r\n<\/pre>\n<h3>\uc6d0\uaca9 \uc800\uc7a5\uc18c \uad00\ub828<\/h3>\n<pre>git remote\r\ngit remote -v\r\n\r\ngit remote add &lt;name&gt; &lt;url&gt;\r\ngit remote rm &lt;name&gt;\r\ngit remote rename &lt;oldname&gt; &lt;newname&gt;\r\n<\/pre>\n<h3>\uc6d0\uaca9 \uc800\uc7a5\uc18c \uad00\ub828 2<\/h3>\n<p>R Studio\uc5d0\uc11c New Project\ub97c \ud55c \ud6c4,<br \/>\ngithub\uc5d0\uc11c \uc0c8\ub85c\uc6b4 repository \uc0dd\uc131 \ud55c \ud6c4,<br \/>\n<code>git remote add origin &lt;ProjectFolder&gt;<\/code>\ub85c \uc6d0\uaca9 \uc800\uc7a5\uc18c\ub97c \uc5f0\uacb0\ud558\uba74,<br \/>\nR Studio\uc758 Pull\/Push \ubc84\ud2bc\uc744 \ub204\ub97c \uc218 \uc5c6\ub2e4.<\/p>\n<p>\uc774\ub54c\uc5d0\ub294 shell\uc5d0\uc11c<br \/>\n<code>git push -u origin master<\/code>\ub97c \ud574 \uc900\ub2e4.<br \/>\n\uc5ec\uae30\uc11c <code>-u<\/code>\ub294 <code>--set-upstream<\/code>\uc758 \uc57d\uc790.<\/p>\n<h3><a href=\"https:\/\/stackoverflow.com\/questions\/6925099\/git-stash-changes-apply-to-new-branch\">commit \ud558\uc9c0 \uc54a\uc740 \ub0b4\uc6a9\uc744 \ub2e4\ub978 \ube0c\ub79c\uce58\ub85c \uc62e\uae30\uae30<\/a><\/h3>\n<pre>git checkout -b &lt;branchname&gt;\r\n<\/pre>\n<h3><a href=\"https:\/\/stackoverflow.com\/questions\/7259135\/git-commit-to-multiple-branches-at-the-same-time\/18529576#18529576\">\ub450 \ube0c\ub79c\uce58\uc5d0 \ub3d9\uc77c\ud55c \ub0b4\uc6a9 commit \ud558\uae30<\/a><\/h3>\n<pre>git checkout &lt;branchA&gt;\r\ngit commit -m \"commit message\"\r\ngit checkout &lt;branchB&gt;\r\ngit cherry-pick &lt;branchA&gt;\r\n<\/pre>\n<ul>\n<li><a href=\"https:\/\/www.git-tower.com\/learn\/git\/faq\/track-remote-upstream-branch\">https:\/\/www.git-tower.com\/learn\/git\/faq\/track-remote-upstream-branch<\/a><\/li>\n<\/ul>\n<hr \/>\n<h2>\ub2e4\ub978 \uc0ac\uc6a9\uc790\uc640 \uacf5\ub3d9 \uc791\uc5c5\ud558\uae30<\/h2>\n<h3>\ub2e4\ub978 \uc0ac\uc6a9\uc790 \ucd08\ub300\ud558\uae30(<a href=\"https:\/\/help.github.com\/articles\/inviting-collaborators-to-a-personal-repository\/\">https:\/\/help.github.com\/articles\/inviting-collaborators-to-a-personal-repository\/<\/a>)<\/h3>\n<ol>\n<li>\uc0ac\uc6a9\uc790\uc774\ub984(username)\uc744 \ud655\uc778\ud55c\ub2e4.<\/li>\n<li>Github\uc758 \uc800\uc7a5\uc18c \uba54\uc778 \ud398\uc774\uc9c0\ub85c \uac04\ub2e4.<\/li>\n<li>Settings(\uc124\uc815)\uc744 \ud074\ub9ad\ud55c\ub2e4.<\/li>\n<li>\uc67c\ucabd \uc0ac\uc774\ub4dc\ubc14\uc5d0\uc11c Collaborators(\uacf5\ub3d9\uc791\uc5c5\uc790)\ub97c \ud074\ub9ad\ud55c\ub2e4.<\/li>\n<li>\uacf5\ub3d9\uc791\uc5c5\uc790\uc758 \uc0ac\uc6a9\uc790\uc774\ub984(username)\uc744 \uc801\ub294\ub2e4.<\/li>\n<li>\ub4dc\ub86d\ub2e4\uc6b4 \uba54\ub274\uc5d0\uc11c \uc0ac\uc6a9\uc790\uc774\ub984\uc744 \uc120\ud0dd\ud55c\ub2e4.<\/li>\n<li>Add collaborator\ub97c \ud074\ub9ad\ud55c\ub2e4.<\/li>\n<\/ol>\n<hr \/>\n<h2>Authentication \uad00\ub828<\/h2>\n<ul>\n<li><a href=\"https:\/\/stackoverflow.com\/questions\/6565357\/git-push-requires-username-and-password\">Git push requires username and password<\/a><\/li>\n<li><a href=\"https:\/\/help.github.com\/articles\/changing-a-remote-s-url\/#switching-remote-urls-from-https-to-ssh\">Changing a remote&#8217;s URL<\/a><\/li>\n<li><a href=\"https:\/\/help.github.com\/articles\/connecting-to-github-with-ssh\/\">Connecting to GitHub with SSH<\/a><\/li>\n<li>\uc77c\ubc18\uc801\uc778 \uc0ac\ud56d : <code>fatal: repository 'https:\/\/github.com\/...\/.git\/' not found<\/code>\uc758 \ud55c \uc6d0\uc778\n<ul>\n<li>RStudio\uc758 Tools &gt; Global Options &gt; Git\/SVN\uc5d0\uc11c SSH RSA Key: \ubd80\ubd84\uc744 \uc8fc\ubaa9\ud55c\ub2e4.<\/li>\n<li>SSH RSA Key\uc758 \ud654\uc77c \uc774\ub984\uc744 \ubcf5\uc0ac\ud55c \ud6c4 \ub4a4\uc5d0 \u201c.pub&#8221;\uc744 \ubd99\uc778 \ud654\uc77c \uc774\ub984\uc744 \uae30\uc5b5\ud55c\ub2e4.(\uc5c6\ub2e4\uba74 linux\uc5d0\uc11c <code>ssh-keygen<\/code>)<\/li>\n<li>cmd \ub610\ub294 git bash\uc5d0\uc11c &#8220;clip &lt; ~\/.ssh\/id_rsa.pub&#8221;\uc744 \ud55c\ub2e4. \uc774\ub54c ~\/.ssh\/id_rsa.pub \ub300\uc2e0 \uc704\uc758 \ud654\uc77c \uc774\ub984\uc744 \uc4f4\ub2e4. (\ud654\uc77c \ub0b4\uc6a9\uc774 \ud074\ub9bd\ubcf4\ub4dc\uc5d0 \ubcf5\uc0ac\ub41c\ub2e4.)<\/li>\n<li>git \uc2f8\uc774\ud2b8\ub85c \ub4e4\uc5b4\uac00\uc11c use setting\/SSH and GPG keys\/New(Add) SSH key\/Key \uc5d0 \ubd99\uc5ec\ub123\uae30\ud55c\ub2e4.<\/li>\n<li>[Add SSH key]\ub97c \ub204\ub978\ub2e4.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h2>SSH Key \uc0dd\uc131<\/h2>\n<pre>ssh-keygen -t rsa -C \"email_id@email.com\"\r\ncat \/...\/...pub # public key \ubcf5\uc0ac\r\n<\/pre>\n<hr \/>\n<h2>\uadf8 \ubc16\uc758 \ucc38\uace0 \uc0ac\ud56d<\/h2>\n<h3><code>lazygit()<\/code> : add, commit, push\ub97c \ud55c \ubc88\uc5d0 \ub05d\ub0b4\uace0 \uc2f6\uc744 \ub54c<\/h3>\n<ul>\n<li><code>lazygit()<\/code><br \/>\n<code><br \/>\nfunction lazygit() {<br \/>\ngit add .<br \/>\ngit commit -a -m \"$1\"<br \/>\ngit push<br \/>\n}<br \/>\n<\/code><\/li>\n<\/ul>\n<h3><a href=\"https:\/\/stackoverflow.com\/questions\/11845321\/search-for-and-view-a-file-deleted-from-the-repo\">\uc0ad\uc81c\ub41c \ud654\uc77c\uc744 commit history\uc5d0\uc11c \ucc3e\uae30<\/a><\/h3>\n<pre>#by filepath and filename\r\ngit log -- filepaht\/filename\r\n#by filename\r\ngit log --diff-filter=D --sumary | grep filename\r\n<\/pre>\n<h3><a href=\"https:\/\/stackoverflow.com\/questions\/18115411\/how-to-merge-specific-files-from-git-branches\">\ube0c\ub79c\uce58\uc5d0\uc11c \ud2b9\uc815\ud55c \ud654\uc77c\ub9cc \uccb4\ud06c\uc544\uc6c3\ud558\uae30<\/a><\/h3>\n<p>\ub9cc\uc57d \uadf8 \ud30c\uc77c\ub4e4\uc5d0 \ub300\ud55c \ubcc0\uacbd\uc0ac\ud56d\uc774 commit\uc73c\ub85c \ub418\uc5b4 \uc788\ub2e4\uba74,<\/p>\n<pre>git checkout &lt;&lt;branch1&gt;&gt;\r\ngit cherry-pick &lt;commit-with-changes-to-file.py&gt;\r\n<\/pre>\n<p>\uadf8\ub807\uc9c0 \uc54a\ub2e4\uba74\u2026<\/p>\n<pre>git checkout &lt;&lt;branch2&gt;&gt;\r\ngit diff &lt;base-commit-before-changes-to-file.py&gt; -- file.py &gt; my.patch\r\ngit checkout &lt;&lt;branch1&gt;&gt;\r\ngit apply my.patch\r\n<\/pre>\n<h3>\uadf8 \ubc16\uc5d0<\/h3>\n<ul>\n<li>Stage(<code>git add<\/code>) \ud558\uc9c0 \uc54a\uc740 \uc218\uc815\uc0ac\ud56d \uc6d0\uc0c1 \ubcf5\uad6c\ud558\uae30<\/li>\n<\/ul>\n<pre>git checkout -- .\r\n<\/pre>\n<pre>git stash save --keep-index --include-untracked\r\n<\/pre>\n<ul>\n<li><strong>\ud2b9\uc815\ud55c \ud30c\uc77c\uc5d0 \ub300\ud574<\/strong> Commit\ud558\uc9c0 \uc54a\uc740 \uc218\uc815\uc0ac\ud56d \uc6d0\uc0c1 \ubcf5\uad6c\ud558\uae30<\/li>\n<\/ul>\n<pre>git checkout &lt;&lt;HASH&gt;&gt; -- file1\/to\/restore \/file2\/to\/restore\r\n<\/pre>\n<p><a href=\"https:\/\/stackoverflow.com\/questions\/215718\/reset-or-revert-a-specific-file-to-a-specific-revision-using-git\">https:\/\/stackoverflow.com\/questions\/215718\/reset-or-revert-a-specific-file-to-a-specific-revision-using-git<\/a><\/p>\n<ul>\n<li>\ub9c8\uc9c0\ub9c9 commit\uc5d0\uc11c \uc218\uc815\ub41c \uc0ac\ud56d \ud655\uc778\ud558\uae30<\/li>\n<\/ul>\n<pre>git diff HEAD^..HEAD\r\ngit log --name-status HEAD^..HEAD\r\n<\/pre>\n<h3>\ucc38\uace0 \uc790\ub8cc<\/h3>\n<ul>\n<li><a href=\"https:\/\/aberdeenstudygroup.github.io\/studyGroup\/lessons\/SG-T1-GitHubVersionControl\/VersionControl\/\">Version control with RStudio and Github<\/a><\/li>\n<li><a href=\"https:\/\/gitster.livejournal.com\/29060.html\">Fun with keeping local changes around<\/a><\/li>\n<li><a href=\"https:\/\/blog.github.com\/2015-06-08-how-to-undo-almost-anything-with-git\/\">How to undo anything with Git<\/a><\/li>\n<li><a href=\"https:\/\/itnext.io\/become-a-git-pro-in-just-one-blog-a-thorough-guide-to-git-architecture-and-command-line-interface-93fbe9bdb395\">Be a git pro in just one blog<\/a><\/li>\n<li>Merge\uc640 Rebase\n<ul>\n<li>Merge\uc640 Rebase\ub294 \ucd5c\uc885 \uacb0\uacfc\ubb3c\uc740 \uac19\uc9c0\ub9cc \ucee4\ubc0b \ud788\uc2a4\ud1a0\ub9ac\uac00 \ub2e4\ub974\ub2e4.<\/li>\n<li>Merge\ub294 \ub450 \ube0c\ub79c\uce58\uc758 \ucd5c\uc885 \uacb0\uacfc\ub9cc\uc744 \uac00\uc9c0\uace0 \ud569\uce58\uace0, Rebase\ub294 \ubcc0\uacbd\uc0ac\ud56d\uc744 \uc21c\uc11c\ub300\ub85c \uc801\uc6a9\ud558\uba74\uc11c \ud788\uc2a4\ud1a0\ub9ac\uac00 \uc120\ud615\uc801\uc774 \ub41c\ub2e4.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\uae43(git), \uc9e7\uc740 \uc18c\uac1c git\uc740 \uc624\ud508\uc18c\uc2a4 \ubd84\uc0b0 \ubc84\uc804 \uad00\ub9ac \uc2dc\uc2a4\ud15c\uc774\ub2e4.[1] git\uc740 \uc18c\uc2a4 \ucf54\ub4dc\uc758 \uc774\ub825\uc744 \uad00\ub9ac\ud55c\ub2e4. \uc774\ub825 \uad00\ub9ac\ub780 \ucf54\ub4dc\uac00 \ubcc0\ud558\ub294 \uacfc\uc815\uc744 \uc800\uc7a5\ud558\ub294 \uac83\uc73c\ub85c \uc0dd\uac01\ud560 \uc218 \uc788\ub2e4. \uc18c\uc2a4\uc5d0\uc11c \uc774\ub825 \uad00\ub9ac\uac00 \uc911\uc694\ud55c \uac83\uc740 \uac1c\ubc1c\ud558\ub294 \uacfc\uc815\uc5d0\uc11c \uc798 \ub418\ub358 \uac83\ub3c4 \uc548 \ub418\ub294 \uc218\ub3c4 \uc788\uae30 \ub54c\ubb38\uc5d0 \uc11c\ub85c \ube44\uad50\ud558\uace0, \uc798\ubabb\ub418\uc5c8\ub2e4\uace0 \ub290\ub07c\uba74 \uc608\uc804 \uc18c\uc2a4\ub85c \ub418\ub3cc\uc544\uac08 \uc218 \uc788\uc5b4\uc57c \ud558\uae30 \ub54c\ubb38\uc774\ub2e4. git\uc740 \uc5ec\ub7ec \uc0ac\ub78c\uc774 \ud611\ub825\ud574\uc11c \uac1c\ubc1c\ud560 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":2476,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[103,104],"tags":[108,110,109,113,105,107,111,112,106],"jetpack_featured_media_url":"http:\/\/ds.sumeun.org\/wp-content\/uploads\/2019\/01\/feather-g02dbbbce6_640.jpg","_links":{"self":[{"href":"http:\/\/ds.sumeun.org\/index.php?rest_route=\/wp\/v2\/posts\/853"}],"collection":[{"href":"http:\/\/ds.sumeun.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/ds.sumeun.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/ds.sumeun.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/ds.sumeun.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=853"}],"version-history":[{"count":14,"href":"http:\/\/ds.sumeun.org\/index.php?rest_route=\/wp\/v2\/posts\/853\/revisions"}],"predecessor-version":[{"id":2477,"href":"http:\/\/ds.sumeun.org\/index.php?rest_route=\/wp\/v2\/posts\/853\/revisions\/2477"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/ds.sumeun.org\/index.php?rest_route=\/wp\/v2\/media\/2476"}],"wp:attachment":[{"href":"http:\/\/ds.sumeun.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=853"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/ds.sumeun.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=853"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/ds.sumeun.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=853"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}