{"id":1179,"date":"2020-02-01T11:27:00","date_gmt":"2020-02-01T11:27:00","guid":{"rendered":"http:\/\/blog.davcloud.top\/?p=1179"},"modified":"2020-07-01T16:05:08","modified_gmt":"2020-07-01T08:05:08","slug":"%e5%a6%82%e4%bd%95%e4%bd%bf%e7%94%a8git%e5%92%8cgithub","status":"publish","type":"post","link":"https:\/\/blog.davcloud.top\/?p=1179&lang=zh","title":{"rendered":"\u5982\u4f55\u4f7f\u7528Git\u548cGithub?"},"content":{"rendered":"\n<h2>\u6458\u8981<\/h2>\n\n\n\n<p>\u8fd9\u7bc7\u6587\u7ae0\u5c06\u4f1a\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528Git\u548cGithub\u8fdb\u884c\u9879\u76ee\u7684\u4e0d\u540c\u7248\u672c\u4e0e\u4e0d\u540c\u5206\u652f\u7ba1\u7406\uff0c\u5e76\u5c06\u4ee5\u521b\u5efa\u4e00\u4e2a\u9879\u76ee\u4e3a\u4f8b\uff0c\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528Git\u8fdb\u884c\u7248\u672c\u63a7\u5236\u5e76\u5c06\u9879\u76ee\u63a8\u9001\u5230Github\u4e0a\u3002\u672c\u6559\u7a0b\u4e2d\u4ee5Linux\u7cfb\u7edf\u4e3a\u4f8b\u8fdb\u884c\u64cd\u4f5c\uff0c\u5728Windows\u7cfb\u7edf\u4e2d\u53ef\u4f7f\u7528Git Bash\u4ee3\u66ffLinux\u4e2d\u7684\u547d\u4ee4\u884c\u3002<\/p>\n\n\n\n<h2>\u7b2c\u4e00\u90e8\u5206\uff1a\u4f7f\u7528Git<\/h2>\n\n\n\n<h3>\u4ec0\u4e48\u662fGit<\/h3>\n\n\n\n<p>Git\u662f\u4e00\u4e2a\u5f00\u6e90\u7684\u5206\u5e03\u5f0f\u7248\u672c\u63a7\u5236\u7cfb\u7edf\uff0c\u53ef\u4ee5\u9ad8\u6548\u3001\u5feb\u901f\u5730\u5904\u7406\u4ece\u5c0f\u578b\u5230\u5927\u578b\u9879\u76ee\u7684\u9879\u76ee\u7248\u672c\u63a7\u5236\u3002 \u4f7f\u7528git\uff0c\u4e00\u4e2a\u9879\u76ee\u53ef\u4ee5\u5206\u4e3a\u591a\u4e2a\u5206\u652f\uff0c\u7531\u4e0d\u540c\u7684\u5f00\u53d1\u8005\u8f7b\u677e\u5f00\u53d1\uff0c\u8fd9\u6709\u52a9\u4e8e\u6539\u5584\u5927\u578b\u9879\u76ee\u7684\u5f00\u53d1\u3002 \u6b64\u5916\uff0c\u5b83\u5141\u8bb8\u5f00\u53d1\u8005\u7ba1\u7406\u9879\u76ee\u7684\u4e0d\u540c\u7248\u672c\uff0c\u4ece\u800c\u5e2e\u52a9\u5f00\u53d1\u8005\u8ddf\u8e2a\u6d41\u7a0b\u5e76\u5728\u53d1\u751f\u610f\u5916\u60c5\u51b5\u65f6\u6062\u590d\u5230\u7a33\u5b9a\u7684\u7248\u672c\u4ee5\u786e\u4fdd\u6b63\u5e38\u5de5\u4f5c\u3002<\/p>\n\n\n\n<h3>\u9996\u6b21\u4f7f\u7528\u914d\u7f6e<\/h3>\n\n\n\n<h4>\u7528\u6237\u540d\u548c\u90ae\u7bb1<\/h4>\n\n\n\n<p>\u914d\u7f6e\u7528\u6237\u540d\u548c\u90ae\u7bb1\uff0c\u8fd9\u5c06\u4f5c\u4e3a\u5728\u6bcf\u6b21\u63d0\u4ea4\u53d8\u66f4\u65f6\u8bb0\u5f55\u7684\u53d8\u66f4\u63d0\u4ea4\u8005\u7684\u4fe1\u606f\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ git config --global user.name \"username\"\n$ git config --global user.email example@email.com<\/code><\/pre>\n\n\n\n<h3>\u521b\u5efa\u4e00\u4e2a\u65b0\u7684Git\u9879\u76ee<\/h3>\n\n\n\n<p>\u5047\u8bbe\u5728\u4e3b\u76ee\u5f55~\/\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a&#8221;hello_world&#8221;\u7684\u9879\u76ee\u3002<\/p>\n\n\n\n<p>\u9996\u5148\uff0c\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a&#8221;hello_world&#8221;\u7684\u6587\u4ef6\u5939\u4f5c\u4e3a\u5de5\u7a0b\u7684\u5de5\u4f5c\u7a7a\u95f4\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>~$ mkdir hello_world<\/code><\/pre>\n\n\n\n<p>\u7136\u540e\u8fdb\u5165\u5de5\u4f5c\u7a7a\u95f4\u5e76\u521d\u59cb\u5316\u672c\u5730\u4ed3\u5e93\uff08\u5de5\u4f5c\u7a7a\u95f4\uff09\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>~$ cd hello_world\n~\/hello_world$ git init<\/code><\/pre>\n\n\n\n<p>\u521b\u5efaREADME.md\u6587\u4ef6\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>~\/hello_world$ touch README.md<\/code><\/pre>\n\n\n\n<h3>\u5de5\u4f5c\u6d41<\/h3>\n\n\n\n<p>\u4ed3\u5e93\u7531\u4e09\u4e2a\u6811\u7ec4\u6210\u3002 \u7b2c\u4e00\u4e2a\u662f\u5de5\u4f5c\u76ee\u5f55\uff0c\u5176\u4e2d\u5305\u542b\u5b9e\u9645\u6587\u4ef6\u3002 \u7b2c\u4e8c\u4e2a\u662f\u7d22\u5f15\uff0c\u5b83\u5145\u5f53\u6682\u5b58\u533a\u57df\u3002 \u7b2c\u4e09\u4e2a\u662fHEAD\uff0c\u5b83\u6307\u5411\u6700\u65b0\u7684\u63d0\u4ea4\u3002<\/p>\n\n\n\n<p>\u5f53\u5de5\u4f5c\u76ee\u5f55\u4e2d\u7684\u6587\u4ef6\u53d1\u751f\u53d8\u66f4\u65f6\uff0c\u5728\u6b63\u5f0f\u63d0\u4ea4\u524d\u9700\u8981\u5c06\u53d8\u66f4\u7684\u90e8\u5206\u6dfb\u52a0\u5230\u6682\u5b58\u533a\u57df\u3002\u63d0\u4ea4\u65f6\uff0c\u6240\u6709\u5728\u6682\u5b58\u533a\u57df\u7684\u53d8\u66f4\u5c06\u4f1a\u63d0\u4ea4\u5230HEAD\u4e2d\uff0c\u540c\u65f6\u6682\u5b58\u533a\u57df\u5c06\u4f1a\u88ab\u6e05\u7a7a\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"http:\/\/rogerdudler.github.io\/git-guide\/img\/trees.png\" alt=\"This image has an empty alt attribute; its file name is trees.png\"\/><\/figure><\/div>\n\n\n\n<h3>\u6dfb\u52a0\u548c\u63d0\u4ea4<\/h3>\n\n\n\n<p>\u5c06\u53d8\u66f4\u6dfb\u52a0\u5230\u7d22\u5f15\u4e2d\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>~\/hello_world$ git add &lt;filename><\/code><\/pre>\n\n\n\n<p>\u4e3a\u4e86\u65b9\u4fbf\uff0c\u53ef\u4ee5\u5c06\u5de5\u4f5c\u76ee\u5f55\u4e0b\u7684\u6240\u6709\u53d8\u66f4\u6dfb\u52a0\u7d22\u5f15\u4e2d\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>~\/hello_world$ git add .<\/code><\/pre>\n\n\n\n<p>\u5c06\u6240\u6709\u53d8\u66f4\u4ece\u7d22\u5f15\u533a\u63d0\u4ea4\u5230HEAD\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>~\/hello_world$ git commit -m \"Commit message\"<\/code><\/pre>\n\n\n\n<p>\u73b0\u5728\u6700\u65b0\u7248\u672c\u7684\u5de5\u7a0b\u5df2\u7ecf\u63d0\u4ea4\u5230HEAD\u4e2d\u3002<\/p>\n\n\n\n<h2>\u7b2c\u4e8c\u90e8\u5206\uff1a\u4f7f\u7528Github<\/h2>\n\n\n\n<h3>\u4ec0\u4e48\u662fGithub<\/h3>\n\n\n\n<p>Github\u662f\u4e00\u5bb6\u5168\u7403\u516c\u53f8\uff0c\u63d0\u4f9b\u4f7f\u7528Git\u8fdb\u884c\u8f6f\u4ef6\u5f00\u53d1\u7248\u672c\u63a7\u5236\u7684\u6258\u7ba1\u3002 \u4f7f\u7528Github\uff0c\u53ef\u4ee5\u5c06\u4ee3\u7801\u5728\u7ebf\u63a8\u9001\u5e76\u7531\u66f4\u591a\u5f00\u53d1\u4eba\u5458\u8fdb\u884c\u5f00\u53d1\u3002 \u6b64\u5916\uff0c\u5b83\u8fd8\u662f\u8457\u540d\u7684\u5f00\u6e90\u4ee3\u7801\u5e73\u53f0\u3002<\/p>\n\n\n\n<h3>\u6ce8\u518cGithub\u8d26\u6237<\/h3>\n\n\n\n<p>\u524d\u5f80Github\u5b98\u7f51\u6ce8\u518c\u8d26\u6237\uff1a<a href=\"https:\/\/github.com\/\">https:\/\/github.com\/<\/a><\/p>\n\n\n\n<h3>\u521b\u5efa\u4e00\u4e2a\u65b0\u7684Github\u4ed3\u5e93<\/h3>\n\n\n\n<h4>\u6b65\u9aa4\u4e00\uff1a\u5728\u83dc\u5355\u4e2d\u9009\u62e9<\/h4>\n\n\n\n<p>\u5728\u83dc\u5355\u4e2d\u9009\u62e9&#8221;New Repository&#8221;\u9009\u9879\uff1a<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img decoding=\"async\" loading=\"lazy\" width=\"168\" height=\"235\" src=\"https:\/\/blog.davcloud.top\/wp-content\/uploads\/2020\/01\/image-8.png\" alt=\"\" class=\"wp-image-1196\"\/><\/figure><\/div>\n\n\n\n<h4>\u6b65\u9aa4\u4e8c\uff1a\u5b8c\u6210\u76f8\u5173\u4fe1\u606f\u586b\u5199<\/h4>\n\n\n\n<p>\u586b\u5199\u4ed3\u5e93\u540d\u79f0\u3001\u63cf\u8ff0\u4ee5\u53ca\u9690\u79c1\u9009\u9879\uff1a<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img decoding=\"async\" loading=\"lazy\" width=\"727\" height=\"649\" src=\"https:\/\/blog.davcloud.top\/wp-content\/uploads\/2020\/01\/image-7.png\" alt=\"\" class=\"wp-image-1195\" srcset=\"https:\/\/blog.davcloud.top\/wp-content\/uploads\/2020\/01\/image-7.png 727w, https:\/\/blog.davcloud.top\/wp-content\/uploads\/2020\/01\/image-7-300x268.png 300w\" sizes=\"(max-width: 727px) 100vw, 727px\" \/><\/figure><\/div>\n\n\n\n<p class=\"has-text-color has-vivid-green-cyan-color\">\u63d0\u793a\uff1a\u514d\u8d39\u8d26\u6237\u53ea\u80fd\u9009\u62e9\u521b\u5efa\u516c\u5171\u4ed3\u5e93\u3002\u5982\u679c\u662f\u5b66\u751f\uff0c\u53ef\u4ee5\u7533\u8bf7\u5b66\u751f\u8d26\u6237\u4ee5\u514d\u8d39\u521b\u5efa\u79c1\u4eba\u4ed3\u5e93\u3002<\/p>\n\n\n\n<p>\u5982\u679c\u60f3\u5c06\u5df2\u7ecf\u5b58\u5728\u7684\u672c\u5730\u4ed3\u5e93\u63a8\u9001\u5230\u8fd9\u4e2a\u4ed3\u5e93\u4e0a\uff0c\u4e0d\u8981\u9009\u62e9&#8221;Initialize this repository with a README&#8221;\u9009\u9879\u3002<\/p>\n\n\n\n<h3>\u5141\u8bb8\u4f60\u7684\u7535\u8111\u8bbf\u95eeGithub\u8d26\u6237<\/h3>\n\n\n\n<h4>\u6b65\u9aa4\u4e00\uff1a\u7f16\u8f91\u8d26\u6237\u8bbe\u7f6e<\/h4>\n\n\n\n<p>\u9009\u62e9\u8d26\u6237\u83dc\u5355\u4e2d\u7684&#8221;Settings&#8221;\u9009\u9879\uff1a<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img decoding=\"async\" loading=\"lazy\" width=\"200\" height=\"458\" src=\"https:\/\/blog.davcloud.top\/wp-content\/uploads\/2020\/01\/image-9.png\" alt=\"\" class=\"wp-image-1197\" srcset=\"https:\/\/blog.davcloud.top\/wp-content\/uploads\/2020\/01\/image-9.png 200w, https:\/\/blog.davcloud.top\/wp-content\/uploads\/2020\/01\/image-9-131x300.png 131w\" sizes=\"(max-width: 200px) 100vw, 200px\" \/><\/figure><\/div>\n\n\n\n<h4>\u6b65\u9aa4\u4e8c\uff1a\u70b9\u51fb&#8221;SSH and GPG keys&#8221;\u9009\u9879<\/h4>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img decoding=\"async\" loading=\"lazy\" width=\"229\" height=\"594\" src=\"https:\/\/blog.davcloud.top\/wp-content\/uploads\/2020\/01\/image-5.png\" alt=\"\" class=\"wp-image-1193\" srcset=\"https:\/\/blog.davcloud.top\/wp-content\/uploads\/2020\/01\/image-5.png 229w, https:\/\/blog.davcloud.top\/wp-content\/uploads\/2020\/01\/image-5-116x300.png 116w\" sizes=\"(max-width: 229px) 100vw, 229px\" \/><\/figure><\/div>\n\n\n\n<h4>\u6b65\u9aa4\u4e09\uff1a\u70b9\u51fb&#8221;New SSH key&#8221;\u9009\u9879<\/h4>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img decoding=\"async\" loading=\"lazy\" width=\"744\" height=\"51\" src=\"https:\/\/blog.davcloud.top\/wp-content\/uploads\/2020\/01\/image-6.png\" alt=\"\" class=\"wp-image-1194\" srcset=\"https:\/\/blog.davcloud.top\/wp-content\/uploads\/2020\/01\/image-6.png 744w, https:\/\/blog.davcloud.top\/wp-content\/uploads\/2020\/01\/image-6-300x21.png 300w\" sizes=\"(max-width: 744px) 100vw, 744px\" \/><\/figure><\/div>\n\n\n\n<h4>\u6b65\u9aa4\u56db\uff1a\u751f\u6210\u7535\u8111\u7684SSH\u516c\u94a5<\/h4>\n\n\n\n<p>\u5728terminal(mac\u548clinux\u7cfb\u7edf)\u6216git bash(Windows\u7cfb\u7edf)\u4e2d\u751f\u6210\u7535\u8111\u7684SSH\u516c\u94a5\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>~$ ssh-keygen -t rsa -C \"example@email.com\"<\/code><\/pre>\n\n\n\n<p>\u90ae\u7bb1\u5730\u5740\u662f\u6ce8\u518cGithub\u65f6\u7684\u90ae\u7bb1\u5730\u5740\u3002<\/p>\n\n\n\n<p>\u7136\u540e\uff0c&#8221;id_rsa.pub&#8221;\u6587\u4ef6\u5c06\u4f1a\u751f\u6210\u5e76\u5b58\u50a8\u5728terminal\u63d0\u793a\u7684\u8def\u5f84\u4e2d\uff0c\u901a\u5e38\u4e3a~\/.ssh\u3002<\/p>\n\n\n\n<h4>\u6b65\u9aa4\u4e94\uff1a\u5c06id_rsa.pub\u4e2d\u7684\u6240\u6709\u6587\u672c\u590d\u5236\u5230Github\u8d26\u6237\u7684\u516c\u94a5\u5217\u8868\u4e2d<\/h4>\n\n\n\n<p>\u4e3a\u8fd9\u4e2a\u516c\u94a5\u6dfb\u52a0\u4e00\u4e2a\u6807\u9898\uff0c\u5e76\u5c06id_ras.pub\u4e2d\u7684\u5168\u90e8\u6587\u672c\u590d\u5236\u5230\u8fd9\u4e2a\u9875\u9762\u4e2d\uff1a<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img decoding=\"async\" loading=\"lazy\" width=\"769\" height=\"421\" src=\"https:\/\/blog.davcloud.top\/wp-content\/uploads\/2020\/01\/image-10.png\" alt=\"\" class=\"wp-image-1198\" srcset=\"https:\/\/blog.davcloud.top\/wp-content\/uploads\/2020\/01\/image-10.png 769w, https:\/\/blog.davcloud.top\/wp-content\/uploads\/2020\/01\/image-10-300x164.png 300w\" sizes=\"(max-width: 769px) 100vw, 769px\" \/><\/figure><\/div>\n\n\n\n<p>SSH\u516c\u94a5\u901a\u5e38\u4ee5&#8221;ssh-rsa&#8221;\u5f00\u5934\uff0c\u4ee5\u90ae\u7bb1\u5730\u5740\u7ed3\u5c3e\u3002<\/p>\n\n\n\n<p>\u7136\u540e\u53ef\u4ee5\u5728SSH\u516c\u94a5\u5217\u8868\u91cc\u770b\u5230\u5df2\u7ecf\u6dfb\u52a0\u7684\u516c\u94a5\u3002<\/p>\n\n\n\n<h3>\u5c06\u672c\u5730\u4ed3\u5e93\u63a8\u9001\u5230Github\u4ed3\u5e93<\/h3>\n\n\n\n<h4>\u4e3a\u672c\u5730\u4ed3\u5e93\u6dfb\u52a0\u8fdc\u7a0b\u4ed3\u5e93<\/h4>\n\n\n\n<p>\u5c06Github\u4ed3\u5e93\u6dfb\u52a0\u4e3a\u672c\u5730\u4ed3\u5e93\u7684\u8fdc\u7a0b\u4ed3\u5e93\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>~\/hello_world$ git remote add origin git@github.com:&lt;username>\/hello_world.git<\/code><\/pre>\n\n\n\n<p>\u8fd9\u4e2a\u5730\u5740\u53ef\u4ee5\u5728github\u4ed3\u5e93\u627e\u5230\uff1a<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img decoding=\"async\" loading=\"lazy\" width=\"906\" height=\"38\" src=\"https:\/\/blog.davcloud.top\/wp-content\/uploads\/2020\/01\/image-11.png\" alt=\"\" class=\"wp-image-1199\" srcset=\"https:\/\/blog.davcloud.top\/wp-content\/uploads\/2020\/01\/image-11.png 906w, https:\/\/blog.davcloud.top\/wp-content\/uploads\/2020\/01\/image-11-300x13.png 300w, https:\/\/blog.davcloud.top\/wp-content\/uploads\/2020\/01\/image-11-768x32.png 768w\" sizes=\"(max-width: 906px) 100vw, 906px\" \/><\/figure><\/div>\n\n\n\n<h4>\u5c06\u672c\u5730\u4ed3\u5e93\u63a8\u9001\u5230\u8fdc\u7a0b\u4ed3\u5e93<\/h4>\n\n\n\n<p>\u8fd0\u884c\u5982\u4e0b\u547d\u4ee4\u63a8\u9001\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>~\/hello_world$ git push -u origin master<\/code><\/pre>\n\n\n\n<h3>\u5206\u652f<\/h3>\n\n\n\n<p>\u5206\u652f\u7528\u4e8e\u5f00\u53d1\u5f7c\u6b64\u5206\u79bb\u800c\u4e0d\u540c\u7684\u529f\u80fd\u3002\u9ed8\u8ba4\u5206\u652f\u4e3a&#8221;master&#8221;\uff0c\u5728\u521b\u5efa\u4ed3\u5e93\u7684\u65f6\u5019\u5c31\u5df2\u7ecf\u81ea\u52a8\u521b\u5efa\u3002\u53ef\u4ee5\u521b\u5efa\u65b0\u7684\u5206\u652f\u6765\u5f00\u53d1\u65b0\u7684\u529f\u80fd\uff0c\u5e76\u4e14\u5728\u5b8c\u6210\u540e\u5c06\u8be5\u5206\u652f\u5408\u5e76\u5230\u4e3b\u5206\u652f&#8221;master&#8221;\u4e2d\u3002<\/p>\n\n\n\n<h4>\u65b0\u5efa\u5206\u652f<\/h4>\n\n\n\n<p>\u65b0\u5efa\u5206\u652f\u5e76\u5207\u6362\u5230\u8be5\u5206\u652f\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>~\/hello_world$ git checkout -b &lt;branch_name><\/code><\/pre>\n\n\n\n<h4>\u5217\u51fa\u5168\u90e8\u5206\u652f<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>~\/hello_world$ git branch<\/code><\/pre>\n\n\n\n<p>\u6240\u6709\u5206\u652f\u90fd\u5c06\u88ab\u5217\u51fa\uff0c\u5e76\u4e14\u5f53\u524d\u5206\u652f\u524d\u4f1a\u4ee5&#8221;*&#8221;\u6807\u8bb0\u3002<\/p>\n\n\n\n<h4>\u5207\u6362\u5206\u652f<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>~\/hello_world$ git checkout &lt;branch_name><\/code><\/pre>\n\n\n\n<h4>\u5220\u9664\u5206\u652f<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>~\/hello_world$ git branch -d &lt;branch_name><\/code><\/pre>\n\n\n\n<h4>\u5c06\u5206\u652f\u63a8\u9001\u5230Github\u4ed3\u5e93\u4e2d<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>~\/hello_world$ git push -u origin &lt;branch_name><\/code><\/pre>\n\n\n\n<h4>\u5c06\u672c\u5730\u4ed3\u5e93\u66f4\u65b0\u5230\u4e0eGithub\u4ed3\u5e93\u540c\u6b65<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>~\/hello_world$ git pull<\/code><\/pre>\n\n\n\n<h4>\u5408\u5e76<\/h4>\n\n\n\n<p>\u4e0d\u540c\u5206\u652f\u53ef\u4ee5\u76f8\u4e92\u5408\u5e76\uff0c\u5982\u4e0b\u547d\u4ee4\u53ef\u4ee5\u5c06\u4e00\u4e2a\u5206\u652f\u5408\u5e76\u5230\u5f53\u524d\u5206\u652f\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>~\/hello_world$ git merge &lt;branch_name><\/code><\/pre>\n\n\n\n<p>\u5982\u679c\u60f3\u8981\u5c06\u4e00\u4e2a\u5206\u652f\u5408\u5e76\u5230master\u5206\u652f\u4e2d\uff0c\u9700\u8981\u5148\u5207\u6362\u5230master\u5206\u652f\u540e\u518d\u5408\u5e76\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>~\/hello_world$ git checkout master\n~\/hello_world$ git merge &lt;branch_name><\/code><\/pre>\n\n\n\n<h2>\u5f15\u7528<\/h2>\n\n\n\n<ol><li><a href=\"http:\/\/rogerdudler.github.io\/git-guide\/index.html\">http:\/\/rogerdudler.github.io\/git-guide\/index.html<\/a><\/li><\/ol>\n","protected":false},"excerpt":{"rendered":"<p>\u6458\u8981 \u8fd9\u7bc7\u6587\u7ae0\u5c06\u4f1a\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528Git\u548cGithub\u8fdb\u884c\u9879\u76ee\u7684\u4e0d\u540c\u7248\u672c\u4e0e\u4e0d\u540c\u5206\u652f\u7ba1\u7406\uff0c\u5e76\u5c06\u4ee5\u521b\u5efa\u4e00\u4e2a\u9879\u76ee\u4e3a\u4f8b\uff0c\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528Git\u8fdb\u884c\u7248\u672c\u63a7\u5236\u5e76\u5c06\u9879\u76ee\u63a8\u9001\u5230Github\u4e0a\u3002\u672c\u6559\u7a0b\u4e2d\u4ee5Linux\u7cfb\u7edf\u4e3a\u4f8b\u8fdb\u884c\u64cd\u4f5c\uff0c\u5728Windows\u7cfb\u7edf\u4e2d\u53ef\u4f7f\u7528Git Bash\u4ee3\u66ffLinux\u4e2d\u7684\u547d\u4ee4\u884c\u3002 \u7b2c\u4e00\u90e8\u5206\uff1a\u4f7f\u7528Git \u4ec0\u4e48\u662fGit Git\u662f\u4e00\u4e2a\u5f00\u6e90\u7684\u5206\u5e03\u5f0f\u7248\u672c\u63a7\u5236\u7cfb\u7edf\uff0c\u53ef\u4ee5\u9ad8\u6548\u3001\u5feb\u901f\u5730\u5904\u7406\u4ece\u5c0f\u578b\u5230\u5927\u578b\u9879\u76ee\u7684\u9879\u76ee\u7248\u672c\u63a7\u5236\u3002 \u4f7f\u7528git\uff0c\u4e00\u4e2a\u9879\u76ee\u53ef\u4ee5\u5206\u4e3a\u591a\u4e2a\u5206\u652f\uff0c\u7531\u4e0d\u540c\u7684\u5f00\u53d1\u8005\u8f7b\u677e\u5f00\u53d1\uff0c\u8fd9\u6709\u52a9\u4e8e\u6539\u5584\u5927\u578b\u9879\u76ee\u7684\u5f00\u53d1\u3002 \u6b64\u5916\uff0c\u5b83\u5141\u8bb8\u5f00\u53d1\u8005\u7ba1\u7406\u9879\u76ee\u7684\u4e0d\u540c\u7248\u672c\uff0c\u4ece\u800c\u5e2e\u52a9\u5f00\u53d1\u8005\u8ddf\u8e2a\u6d41\u7a0b\u5e76\u5728\u53d1\u751f\u610f\u5916\u60c5\u51b5\u65f6\u6062\u590d\u5230\u7a33\u5b9a\u7684\u7248\u672c\u4ee5\u786e\u4fdd\u6b63\u5e38\u5de5\u4f5c\u3002 \u9996\u6b21\u4f7f\u7528\u914d\u7f6e \u7528\u6237\u540d\u548c\u90ae\u7bb1 \u914d\u7f6e\u7528\u6237\u540d\u548c\u90ae\u7bb1\uff0c\u8fd9\u5c06\u4f5c\u4e3a\u5728\u6bcf\u6b21\u63d0\u4ea4\u53d8\u66f4\u65f6\u8bb0\u5f55\u7684\u53d8\u66f4\u63d0\u4ea4\u8005\u7684\u4fe1\u606f\uff1a \u521b\u5efa\u4e00\u4e2a\u65b0\u7684Git\u9879\u76ee \u5047\u8bbe\u5728\u4e3b\u76ee\u5f55~\/\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a&#8221;hello_world&#8221;\u7684\u9879\u76ee\u3002 \u9996\u5148\uff0c\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a&#8221;hello_world&#8221;\u7684\u6587\u4ef6\u5939\u4f5c\u4e3a\u5de5\u7a0b\u7684\u5de5\u4f5c\u7a7a\u95f4\uff1a \u7136\u540e\u8fdb\u5165\u5de5\u4f5c\u7a7a\u95f4\u5e76\u521d\u59cb\u5316\u672c\u5730\u4ed3\u5e93\uff08\u5de5\u4f5c\u7a7a\u95f4\uff09\uff1a \u521b\u5efaREADME.md\u6587\u4ef6\uff1a \u5de5\u4f5c\u6d41 \u4ed3\u5e93\u7531\u4e09\u4e2a\u6811\u7ec4\u6210\u3002 \u7b2c\u4e00\u4e2a\u662f\u5de5\u4f5c\u76ee\u5f55\uff0c\u5176\u4e2d\u5305\u542b\u5b9e\u9645\u6587\u4ef6\u3002 \u7b2c\u4e8c\u4e2a\u662f\u7d22\u5f15\uff0c\u5b83\u5145\u5f53\u6682\u5b58\u533a\u57df\u3002 \u7b2c\u4e09\u4e2a\u662fHEAD\uff0c\u5b83\u6307\u5411\u6700\u65b0\u7684\u63d0\u4ea4\u3002 \u5f53\u5de5\u4f5c\u76ee\u5f55\u4e2d\u7684\u6587\u4ef6\u53d1\u751f\u53d8\u66f4\u65f6\uff0c\u5728\u6b63\u5f0f\u63d0\u4ea4\u524d\u9700\u8981\u5c06\u53d8\u66f4\u7684\u90e8\u5206\u6dfb\u52a0\u5230\u6682\u5b58\u533a\u57df\u3002\u63d0\u4ea4\u65f6\uff0c\u6240\u6709\u5728\u6682\u5b58\u533a\u57df\u7684\u53d8\u66f4\u5c06\u4f1a\u63d0\u4ea4\u5230HEAD\u4e2d\uff0c\u540c\u65f6\u6682\u5b58\u533a\u57df\u5c06\u4f1a\u88ab\u6e05\u7a7a\u3002 \u6dfb\u52a0\u548c\u63d0\u4ea4 \u5c06\u53d8\u66f4\u6dfb\u52a0\u5230\u7d22\u5f15\u4e2d\uff1a \u4e3a\u4e86\u65b9\u4fbf\uff0c\u53ef\u4ee5\u5c06\u5de5\u4f5c\u76ee\u5f55\u4e0b\u7684\u6240\u6709\u53d8\u66f4\u6dfb\u52a0\u7d22\u5f15\u4e2d\uff1a \u5c06\u6240\u6709\u53d8\u66f4\u4ece\u7d22\u5f15\u533a\u63d0\u4ea4\u5230HEAD\uff1a \u73b0\u5728\u6700\u65b0\u7248\u672c\u7684\u5de5\u7a0b\u5df2\u7ecf\u63d0\u4ea4\u5230HEAD\u4e2d\u3002 \u7b2c\u4e8c\u90e8\u5206\uff1a\u4f7f\u7528Github \u4ec0\u4e48\u662fGithub Github\u662f\u4e00\u5bb6\u5168\u7403\u516c\u53f8\uff0c\u63d0\u4f9b\u4f7f\u7528Git\u8fdb\u884c\u8f6f\u4ef6\u5f00\u53d1\u7248\u672c\u63a7\u5236\u7684\u6258\u7ba1\u3002 \u4f7f\u7528Github\uff0c\u53ef\u4ee5\u5c06\u4ee3\u7801\u5728\u7ebf\u63a8\u9001\u5e76\u7531\u66f4\u591a\u5f00\u53d1\u4eba\u5458\u8fdb\u884c\u5f00\u53d1\u3002 \u6b64\u5916\uff0c\u5b83\u8fd8\u662f\u8457\u540d\u7684\u5f00\u6e90\u4ee3\u7801\u5e73\u53f0\u3002 \u6ce8\u518cGithub\u8d26\u6237 \u524d\u5f80Github\u5b98\u7f51\u6ce8\u518c\u8d26\u6237\uff1ahttps:\/\/github.com\/ \u521b\u5efa\u4e00\u4e2a\u65b0\u7684Github\u4ed3\u5e93 \u6b65\u9aa4\u4e00\uff1a\u5728\u83dc\u5355\u4e2d\u9009\u62e9 \u5728\u83dc\u5355\u4e2d\u9009\u62e9&#8221;New Repository&#8221;\u9009\u9879\uff1a \u6b65\u9aa4\u4e8c\uff1a\u5b8c\u6210\u76f8\u5173\u4fe1\u606f\u586b\u5199 \u586b\u5199\u4ed3\u5e93\u540d\u79f0\u3001\u63cf\u8ff0\u4ee5\u53ca\u9690\u79c1\u9009\u9879\uff1a \u63d0\u793a\uff1a\u514d\u8d39\u8d26\u6237\u53ea\u80fd\u9009\u62e9\u521b\u5efa\u516c\u5171\u4ed3\u5e93\u3002\u5982\u679c\u662f\u5b66\u751f\uff0c\u53ef\u4ee5\u7533\u8bf7\u5b66\u751f\u8d26\u6237\u4ee5\u514d\u8d39\u521b\u5efa\u79c1\u4eba\u4ed3\u5e93\u3002 \u5982\u679c\u60f3\u5c06\u5df2\u7ecf\u5b58\u5728\u7684\u672c\u5730\u4ed3\u5e93\u63a8\u9001\u5230\u8fd9\u4e2a\u4ed3\u5e93\u4e0a\uff0c\u4e0d\u8981\u9009\u62e9&#8221;Initialize this repository with a README&#8221;\u9009\u9879\u3002 \u5141\u8bb8\u4f60\u7684\u7535\u8111\u8bbf\u95eeGithub\u8d26\u6237 \u6b65\u9aa4\u4e00\uff1a\u7f16\u8f91\u8d26\u6237\u8bbe\u7f6e \u9009\u62e9\u8d26\u6237\u83dc\u5355\u4e2d\u7684&#8221;Settings&#8221;\u9009\u9879\uff1a \u6b65\u9aa4\u4e8c\uff1a\u70b9\u51fb&#8221;SSH and GPG keys&#8221;\u9009\u9879 \u6b65\u9aa4\u4e09\uff1a\u70b9\u51fb&#8221;New [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[469],"tags":[582,584],"_links":{"self":[{"href":"https:\/\/blog.davcloud.top\/index.php?rest_route=\/wp\/v2\/posts\/1179"}],"collection":[{"href":"https:\/\/blog.davcloud.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.davcloud.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.davcloud.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.davcloud.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1179"}],"version-history":[{"count":25,"href":"https:\/\/blog.davcloud.top\/index.php?rest_route=\/wp\/v2\/posts\/1179\/revisions"}],"predecessor-version":[{"id":1528,"href":"https:\/\/blog.davcloud.top\/index.php?rest_route=\/wp\/v2\/posts\/1179\/revisions\/1528"}],"wp:attachment":[{"href":"https:\/\/blog.davcloud.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1179"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.davcloud.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1179"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.davcloud.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1179"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}