{"id":177380,"date":"2020-04-29T10:21:42","date_gmt":"2020-04-29T02:21:42","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=177380"},"modified":"2020-04-20T09:43:32","modified_gmt":"2020-04-20T01:43:32","slug":"git-introduction","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/git-introduction.html","title":{"rendered":"Git\u6982\u8ff0"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n\u7248\u672c\u63a7\u5236\u7cfb\u7edf\u662f\u4e00\u79cd\u8bb0\u5f55\u4e00\u4e2a\u6216\u82e5\u5e72\u6587\u4ef6\u5185\u5bb9\u53d8\u5316\uff0c\u4ee5\u4fbf\u5c06\u6765\u67e5\u9605\u7279\u5b9a\u7248\u672c\u4fee\u8ba2\u60c5\u51b5\u7684\u7cfb\u7edf\u3002\u7248\u672c\u63a7\u5236\u7cfb\u7edf\u4e0d\u4ec5\u53ef\u4ee5\u5e94\u7528\u4e8e\u8f6f\u4ef6\u6e90\u4ee3\u7801\u7684\u6587\u672c\u6587\u4ef6\uff0c\u800c\u4e14\u53ef\u4ee5\u5bf9\u4efb\u4f55\u7c7b\u578b\u7684\u6587\u4ef6\u8fdb\u884c\u7248\u672c\u63a7\u5236\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u76f4\u767d\u7684\u8bb2\uff0c\u7248\u672c\u63a7\u5236\u7cfb\u7edf\u5c31\u662f\u5bf9\u5e94\u7528\u8f6f\u4ef6\u7684\u6e90\u4ee3\u7801\u7684\u7248\u672c\u5b9e\u73b0\u63a7\u5236\uff0c\u4ee5\u5b9e\u73b0\u4e0d\u540c\u7248\u672c\u4e4b\u95f4\u7684\u5207\u6362\uff0c\u56de\u6eda\uff0c\u5386\u53f2\u4fe1\u606f\u8ffd\u6eaf\u7b49\u9700\u6c42\u3002<\/p>\n

\u7248\u672c\u63a7\u5236\u7cfb\u7edf\u76ee\u524d\u4e3b\u8981\u6709\u4e24\u7c7b\uff1a<\/p>\n

\u96c6\u4e2d\u5f0f\u7248\u672c\u63a7\u5236\u7cfb\u7edf\uff0c\u5176\u4ee3\u8868\u4e3asvn<\/p>\n

\u5206\u5e03\u5f0f\u7248\u672c\u63a7\u5236\u7cfb\u7edf\uff0c\u5176\u4ee3\u8868\u4e3agit<\/p>\n

\u96c6\u4e2d\u5f0f\u7248\u672c\u63a7\u5236\u7cfb\u7edf<\/strong><\/span><\/div>\n

\u4e3a\u4e86\u8ba9\u4e0d\u540c\u7cfb\u7edf\u4e0a\u7684\u5f00\u53d1\u8005\u80fd\u591f\u534f\u540c\u5de5\u4f5c\uff0c\u96c6\u4e2d\u5316\u7684\u7248\u672c\u63a7\u5236\u7cfb\u7edf\u5e94\u8fd0\u800c\u751f\uff08CVCS\uff09\u3002\u8fd9\u7c7b\u7cfb\u7edf\u90fd\u6709\u4e00\u4e2a\u5355\u4e00\u7684\u96c6\u4e2d\u7ba1\u7406\u7684\u670d\u52a1\u5668\uff0c\u4fdd\u5b58\u6240\u6709\u6587\u4ef6\u7684\u4fee\u8ba2\u7248\u672c\u3002\u800c\u534f\u540c\u5de5\u4f5c\u7684\u4eba\u4eec\u90fd\u901a\u8fc7\u5ba2\u6237\u7aef\u8fde\u63a5\u5230\u8fd9\u53f0\u670d\u52a1\u5668\uff0c\u83b7\u53d6\u6700\u65b0\u7684\u6587\u4ef6\u6216\u8005\u63d0\u4ea4\u66f4\u65b0\u3002\u5176\u4e2d\u6700\u8457\u540d\u7684\u5c31\u662fCVS\u548cSubversion\u3002<\/p>\n

\u96c6\u4e2d\u5316\u7684\u7248\u672c\u63a7\u5236\u7cfb\u7edf\uff0c\u4e8b\u5b9e\u4e0a\uff0c\u7f3a\u70b9\u4e5f\u663e\u800c\u6613\u89c1\uff0c\u5373\u4e2d\u592e\u670d\u52a1\u5668\u7684\u5355\u70b9\u6545\u969c\u95ee\u9898\u3002\u5982\u679c\u5b95\u673a\uff0c\u90a3\u4e48\u5c31\u4f1a\u51fa\u73b0\u8c01\u90fd\u65e0\u6cd5\u63d0\u4ea4\u66f4\u65b0\u7684\u60c5\u51b5\uff0c\u90a3\u4e48\u4e5f\u5c31\u65e0\u6cd5\u534f\u540c\u5de5\u4f5c\uff1b\u5982\u679c\u78c1\u76d8\u53d1\u751f\u6545\u969c\uff0c\u800c\u5907\u4efd\u53c8\u4e0d\u591f\u5373\u65f6\uff0c\u90a3\u4e48\u5c31\u6709\u4e22\u5931\u6570\u636e\u7684\u98ce\u9669\uff0c\u6700\u574f\u7684\u60c5\u51b5\u662f\u4e22\u5931\u6574\u4e2a\u9879\u76ee\u7684\u5386\u53f2\u66f4\u6539\u8bb0\u5f55\u3002\u56e0\u6b64\uff0c\u5206\u5e03\u5f0f\u7248\u672c\u63a7\u5236\u7cfb\u7edf\u95ee\u4e16\u4e86\uff08DVCS\uff09\u3002<\/p>\n

\u5206\u5e03\u5f0f\u7248\u672c\u63a7\u5236\u7cfb\u7edf<\/strong><\/span><\/div>\n

\u5728\u5206\u5e03\u5f0f\u7248\u672c\u63a7\u5236\u7cfb\u7edf\u4e2d\uff0c\u5ba2\u6237\u7aef\u4e0d\u4ec5\u4ec5\u662f\u53ea\u63d0\u53d6\u6700\u65b0\u7248\u672c\u7684\u6587\u4ef6\u5feb\u7167\uff0c\u800c\u662f\u628a\u4ee3\u7801\u4ed3\u5e93\u5b8c\u6574\u7684\u955c\u50cf\u4e0b\u6765\u3002\u6240\u4ee5\u6bcf\u4e00\u6b21\u63d0\u53d6\u7684\u64cd\u4f5c\uff0c\u90fd\u662f\u5bf9\u4ee3\u7801\u4ed3\u5e93\u7684\u5b8c\u6574\u5907\u4efd\uff0c\u56e0\u6b64\u4e5f\u5c31\u4e0d\u5fc5\u62c5\u5fc3\u534f\u540c\u5de5\u4f5c\u7528\u7684\u670d\u52a1\u5668\u53d1\u751f\u6545\u969c\u3002<\/p>\n

Git\u8d77\u6e90<\/strong><\/span><\/div>\n

\u540c\u751f\u6d3b\u4e2d\u7684\u8bb8\u591a\u4f1f\u5927\u4e8b\u4ef6\u4e00\u6837\uff0cGit \u8bde\u751f\u4e8e\u4e00\u4e2a\u6781\u5bcc\u7eb7\u4e89\u5927\u4e3e\u521b\u65b0\u7684\u5e74\u4ee3\u3002Linux \u5185\u6838\u5f00\u6e90\u9879\u76ee\u6709\u7740\u4e3a\u6570\u4f17\u5e7f\u7684\u53c2\u4e0e\u8005\u3002\u7edd\u5927\u591a\u6570\u7684 Linux \u5185\u6838\u7ef4\u62a4\u5de5\u4f5c\u90fd\u82b1\u5728\u4e86\u63d0\u4ea4\u8865\u4e01\u548c\u4fdd\u5b58\u5f52\u6863\u7684\u7e41\u7410\u4e8b\u52a1\u4e0a\uff081991\uff0d2002\u5e74\u95f4\uff09\u3002<\/p>\n

\u4e00\u76f4\u52302002\u5e74\uff0cLinux\u7cfb\u7edf\u7ecf\u8fc7\u5341\u4f59\u5e74\u7684\u4e0d\u65ad\u53d1\u5c55\uff0c\u4ee3\u7801\u5e93\u5df2\u7ecf\u5e9e\u5927\u5230\u65e0\u6cd5\u518d\u8ba9Linus\u901a\u8fc7\u624b\u5de5\u7684\u65b9\u5f0f\u7ba1\u7406\u4e86\uff0c\u4f46\u662fLinus\u771f\u7684\u5f88\u4e0d\u559c\u6b22CVS\u6216\u8005Subversion\u7248\u672c\u63a7\u5236\u7cfb\u7edf\uff0c\u4e8e\u662f\u5546\u4e1a\u516c\u53f8BitMover\u51b3\u5b9a\u5c06\u5176\u516c\u53f8\u7684BitKeeper\u5206\u5e03\u5f0f\u7248\u672c\u63a7\u5236\u7cfb\u7edf\u6388\u6743\u7ed9Linux\u5f00\u53d1\u793e\u533a\u6765\u514d\u8d39\u4f7f\u7528\uff0c\u5f53\u65f6\u7684BitKeeper\u53ef\u4ee5\u6bd4\u8f83\u6587\u4ef6\u5185\u5bb9\u7684\u4e0d\u540c\uff0c\u8fd8\u80fd\u591f\u5c06\u51fa\u9519\u7684\u6587\u6863\u8fd8\u539f\u5230\u5386\u53f2\u67d0\u4e2a\u72b6\u6001\uff0cLinus\u7ec8\u4e8e\u653e\u4e0b\u4e86\u5fc3\u91cc\u7684\u77f3\u5934\u3002<\/p>\n

\u5c31\u8fd9\u6837\u8fc7\u4e86\u4e09\u5e74\u65f6\u95f4\uff0c\u7531\u4e8eLinux\u793e\u533a\u805a\u96c6\u7740\u592a\u591a\u7684\u9ed1\u5ba2\u4eba\u7269\uff0c2005\u5e74\uff0c\u90a3\u4f4d\u66fe\u7ecf\u5f00\u53d1Samba\u670d\u52a1\u7a0b\u5e8f\u7684Andrew\u56e0\u4e3a\u8bd5\u56fe\u7834\u89e3BitKeeper\u8f6f\u4ef6\u534f\u8bae\u800c\u6fc0\u6012\u4e86BitMover\u516c\u53f8\uff0c\u5f53\u5373\u51b3\u5b9a\u4e0d\u518d\u5411Linux\u793e\u533a\u63d0\u4f9b\u514d\u8d39\u7684\u8f6f\u4ef6\u6388\u6743\uff0c\u6b64\u65f6\u7684Linus\u5176\u5b9e\u4e5f\u65e9\u5df2\u6709\u81ea\u5df1\u7f16\u5199\u5206\u5e03\u5f0f\u7248\u672c\u63a7\u5236\u7cfb\u7edf\u7684\u6253\u7b97\u4e86\uff0c\u4e8e\u662f\u4fbf\u7528C\u8bed\u8a00\u82b1\u4e862\u5468\u521b\u5efa\u4e86Git\u5206\u5e03\u5f0f\u7248\u672c\u63a7\u5236\u7cfb\u7edf\uff0c\u5e76\u4e0a\u4f20\u4e86Linux\u7cfb\u7edf\u7684\u6e90\u4ee3\u7801\u3002<\/p>\n

Git\u7279\u6027<\/strong><\/span><\/div>\n

\u76f8\u5bf9\u4e8e\u5176\u4ed6\u7248\u672c\u63a7\u5236\u7cfb\u7edf\uff0cgit\u6709\u5982\u4e0b\u7279\u6027\uff1a<\/p>\n

Git\u53ea\u5173\u5fc3\u6587\u4ef6\u6570\u636e\u7684\u6574\u4f53\u662f\u5426\u53d1\u751f\u4e86\u53d8\u5316\uff0c\u800c\u591a\u6570\u7684\u5176\u4ed6\u7cfb\u7edf\u5219\u53ea\u5173\u5fc3\u6587\u4ef6\u5185\u5bb9\u7684\u5177\u4f53\u5dee\u5f02\uff0c\u5b83\u4eec\u5728\u6bcf\u4e2a\u7248\u672c\u4e2d\u8bb0\u5f55\u7740\u5404\u4e2a\u6587\u4ef6\u7684\u5177\u4f53\u5dee\u5f02\u3002<\/p>\n

\u5728Git\u4e2d\u7684\u7edd\u5927\u591a\u6570\u64cd\u4f5c\u90fd\u53ea\u9700\u8981\u8bbf\u95ee\u672c\u5730\u6587\u4ef6\u548c\u8d44\u6e90\uff0c\u4e0d\u9700\u8981\u8054\u7f51\u3002\u8fd9\u662f\u56e0\u4e3aGit\u5728\u672c\u5730\u78c1\u76d8\u4e0a\u5c31\u4fdd\u7559\u7740\u6240\u6709\u5f53\u524d\u9879\u76ee\u7684\u5386\u53f2\u66f4\u65b0\uff0c\u6240\u4ee5\u5904\u7406\u8d77\u6765\u901f\u5ea6\u98de\u5feb\uff0c\u8fd9\u662f\u4f7f\u7528\u7a7a\u95f4\u6362\u65f6\u95f4\u7684\u5904\u7406\u65b9\u5f0f\u3002<\/p>\n

\u4f7f\u7528Git\uff0c\u5373\u4f7f\u5728\u6ca1\u6709\u7f51\u7edc\u6216VPN\u7684\u60c5\u51b5\u4e0b\uff0c\u4f60\u540c\u6837\u53ef\u4ee5\u975e\u5e38\u6109\u5feb\u7684\u9891\u7e41\u63d0\u4ea4\u66f4\u65b0\uff0c\u7b49\u5230\u6709\u4e86\u7f51\u7edc\u7684\u65f6\u5019\u518d\u63d0\u4ea4\u5230\u8fdc\u7a0b\u7684\u4ed3\u5e93\u3002<\/p>\n

\u5bf9\u4e8e\u4efb\u4f55\u4e00\u4e2a\u6587\u4ef6\uff0c\u5728Git\u5185\u90e8\u90fd\u53ea\u6709\u4e09\u79cd\u72b6\u6001\uff1a<\/p>\n

\u5df2\u63d0\u4ea4(committed)\uff1a\u8868\u793a\u6570\u636e\u6587\u4ef6\u5df2\u7ecf\u987a\u5229\u63d0\u4ea4\u5230Git\u6570\u636e\u5e93\u4e2d\u3002<\/p>\n

\u5df2\u4fee\u6539(modified)\uff1a\u8868\u793a\u6570\u636e\u6587\u4ef6\u5df2\u7ecf\u88ab\u4fee\u6539\uff0c\u4f46\u672a\u88ab\u4fdd\u5b58\u5230Git\u6570\u636e\u5e93\u4e2d\u3002<\/p>\n

\u5df2\u6682\u5b58(staged)\uff1a\u8868\u793a\u6570\u636e\u6587\u4ef6\u5df2\u7ecf\u88ab\u4fee\u6539\uff0c\u5e76\u4f1a\u5728\u4e0b\u6b21\u63d0\u4ea4\u65f6\u63d0\u4ea4\u5230Git\u6570\u636e\u5e93\u4e2d\u3002<\/p>\n

Git\u5728\u7ba1\u7406\u9879\u76ee\u65f6\uff0c\u6587\u4ef6\u6d41\u8f6c\u7684\u4e09\u4e2a\u5de5\u4f5c\u533a\u57df\u662f\uff1a\u672c\u5730\u4ed3\u5e93(\u5373\u5de5\u4f5c\u76ee\u5f55\uff0c\u4e5f\u5c31\u662f\u9879\u76ee\u7684\u6e90\u6587\u4ef6)->\u6682\u5b58\u533a\u57df->Git\u7684\u5de5\u4f5c\u76ee\u5f55\u3002\u56e0\u6b64\uff0c\u57fa\u672c\u7684Git\u5de5\u4f5c\u6d41\u7a0b\u5982\u4e0b\uff1a \u5728\u672c\u5730\u7684\u5de5\u4f5c\u76ee\u5f55\u4fee\u6539\u67d0\u4e9b\u6587\u4ef6\uff1b\u7136\u540e\u5bf9\u4fee\u6539\u540e\u7684\u6587\u4ef6\u8fdb\u884c\u5feb\u7167\uff0c\u4fdd\u5b58\u5230\u6682\u5b58\u533a\u57df\uff1b\u6700\u540e\u63d0\u4ea4\u66f4\u65b0\uff0c\u5c06\u4fdd\u5b58\u5728\u6682\u5b58\u533a\u57df\u4e2d\u7684\u6587\u4ef6\u5feb\u7167\u6c38\u4e45\u8f6c\u5b58\u5230Git\u7684\u5de5\u4f5c\u76ee\u5f55\u4e2d\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

\u76f4\u767d\u7684\u8bb2\uff0c\u7248\u672c\u63a7\u5236\u7cfb\u7edf\u5c31\u662f\u5bf9\u5e94\u7528\u8f6f\u4ef6\u7684\u6e90\u4ee3\u7801\u7684\u7248\u672c\u5b9e\u73b0\u63a7\u5236\uff0c\u4ee5\u5b9e\u73b0\u4e0d\u540c\u7248\u672c\u4e4b\u95f4\u7684\u5207\u6362\uff0c\u56de\u6eda\uff0c\u5386\u53f2\u4fe1\u606f\u8ffd\u6eaf\u7b49\u9700\u6c42 […]<\/p>\n","protected":false},"author":1479,"featured_media":26621,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-177380","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/177380","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/1479"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=177380"}],"version-history":[{"count":6,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/177380\/revisions"}],"predecessor-version":[{"id":177417,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/177380\/revisions\/177417"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/26621"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=177380"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=177380"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=177380"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}