{"id":432,"date":"2019-09-23T22:32:03","date_gmt":"2019-09-23T14:32:03","guid":{"rendered":"https:\/\/103.249.111.182\/?p=432"},"modified":"2019-09-23T22:32:03","modified_gmt":"2019-09-23T14:32:03","slug":"%e7%ac%94%e8%ae%b0git%e4%bd%bf%e7%94%a8%e6%80%bb%e7%bb%93","status":"publish","type":"post","link":"https:\/\/7gugu.com\/index.php\/2019\/09\/23\/%e7%ac%94%e8%ae%b0git%e4%bd%bf%e7%94%a8%e6%80%bb%e7%bb%93\/","title":{"rendered":"[\u7b14\u8bb0]Git\u4f7f\u7528\u603b\u7ed3"},"content":{"rendered":"<h2>\u5bfc\u8bba<\/h2>\n<p>\u6700\u8fd1\u5b66\u6821\u8001\u5e08\u5e03\u7f6e\u4e86&#8221;\u9879\u76ee\u7248\u672c\u7ba1\u7406&#8221;,\u7136\u540e\u641e\u4e86\u4e00\u5468,\u603b\u7ed3\u4e86\u4e00\u4e9b\u534f\u4f5c\u7684\u7ecf\u9a8c,\u5199\u5728\u8fd9\u91cc,\u65b9\u4fbf\u5927\u5bb6\u4e5f\u65b9\u4fbf\u65e5\u540e\u7684\u81ea\u5df1\u3002<\/p>\n<h2>\u4e0b\u8f7d\u4ed3\u5e93\u7684\u4ee3\u7801<\/h2>\n<ol>\n<li>\u8bbf\u95ee\u7f51\u9875\u4ed3\u5e93<\/li>\n<li>\u83b7\u53d6SSH\/HTTP\u94fe\u63a5<\/li>\n<li>cmd\u4e2d\u8f93\u5165\u4ee5\u4e0b\u6307\u4ee4<\/li>\n<\/ol>\n<pre>\ngit clone \u4ed3\u5e93\u5730\u5740\n<\/pre>\n<h2>\u63d0\u4ea4\u81ea\u5df1\u7684\u4ee3\u7801\u5230Git\u5e93<\/h2>\n<ol>\n<li>\u4fee\u6539\u81ea\u5df1\u7684\u4ee3\u7801<\/li>\n<li>\u6267\u884c\u4ee5\u4e0b\u6307\u4ee4<\/li>\n<\/ol>\n<pre>\ngit add * \/\/\u628a\u4ee3\u7801\u4ece\u5de5\u4f5c\u533a\u63d0\u4ea4\u5230\u7f13\u5b58\u533a\ngit commit -m \"message\" \/\/\u6dfb\u52a0\u4ee3\u7801\u5907\u6ce8\ngit push [--set-upstream origin branchname] \/\/\u5047\u5982\u4f7f\u7528\u65b0\u7684\u5206\u652f,\u5c31\u9700\u8981\u8bbe\u5b9a\u5206\u652f\u70b9[\u4e00\u822c\u4ecemaster\u5206\u652f]\n<\/pre>\n<h2>\u62c9\u53d6\u66f4\u65b0\u5230\u672c\u5730<\/h2>\n<ul>\n<li>\u5982\u679cmaster\u662f\u81ea\u5df1\u63a7\u5236\u7684,\u6267\u884c\u4ee5\u4e0b\u4ee3\u7801\u5373\u53ef<\/li>\n<\/ul>\n<pre>\ngit pull \n<\/pre>\n<ul>\n<li>\u5982\u679cmaster\u662f\u522b\u4eba\u7684,\u4f60\u53ea\u662f\u4e00\u4e2a\u8d21\u732e\u8005,\u5c31\u9700\u8981\u6267\u884c\u4ee5\u4e0b\u4ee3\u7801\u4e86<\/li>\n<\/ul>\n<pre>\ngit checkout master \/\/\u5408\u5e76\u5206\u4e4b\u540e,\u8981\u5148\u5207\u6362\u5230\u4e3b\u5206\u652f\u624d\u80fd\u62c9\u53d6\u5230\u65b0\u6570\u636e\ngit pull\ngit checkout branchname \/\/\u5207\u6362\u56de\u81ea\u8eab\u5206\u652f\u8fdb\u884c\u5f00\u53d1\ngit merge master \/\/\u5408\u5e76\u672c\u5730\u5206\u652f\n<\/pre>\n<p>\u5b8c\u6210\u4e0a\u8ff0\u7684\u4ee3\u7801,\u5373\u53ef\u987a\u5229\u7684\u66f4\u65b0\u672c\u5730\u4ee3\u7801\u3002\u5982\u679c\u53d1\u751f\u51b2\u7a81,\u5c31\u9700\u8981\u5148\u624b\u52a8\u89e3\u51b3\u4e86\u51b2\u7a81\u624d\u80fd\u5408\u5e76\u672c\u5730\u5206\u652f\u3002<\/p>\n<h2>\u56de\u6eda\u7248\u672c<\/h2>\n<ul>\n<li>\u6267\u884c\u4ee5\u4e0b\u4ee3\u7801\u5373\u53ef<\/li>\n<\/ul>\n<pre>\ngit reset --hard \u7248\u672c\u53f7 \/\/\u7248\u672c\u53f7\u5c31\u662f\u90a3\u4e00\u4e32\u6570\u5b57\u5b57\u6bcd\u6df7\u5408\u7684\u5b57\u7b26\u4e32,\u53ef\u4ee5\u7528\u7f29\u5199,git\u4f1a\u81ea\u52a8\u8bc6\u522b\n<\/pre>\n<h2>\u7ed3\u675f<\/h2>\n<p>\u8fd9\u5468\u5927\u6982\u5c31\u53ea\u603b\u7ed3\u5230\u8fd9\u4e9b\u7ecf\u9a8c,\u4f46\u4e2d\u4e86\u8fd9\u4e48\u591a\u5751\u4e4b\u540e,\u603b\u7ed3\u51fa\u4e86git\u6b63\u786e\u7684\u4f7f\u7528\u59ff\u52bf\u4e5f\u7b97\u662f\u4e00\u5927\u6536\u83b7\u4e86\u3002\u786e\u5b9e\u5f88\u5f00\u5fc3:\uff09\u5c31\u5148\u5199\u5230\u8fd9\u5427,\u4ee5\u540e\u6709\u66f4\u591a\u59ff\u52bf\u518d\u5199\u8fdb\u6765\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5bfc\u8bba \u6700\u8fd1\u5b66\u6821\u8001\u5e08\u5e03\u7f6e\u4e86&#8221;\u9879\u76ee\u7248\u672c\u7ba1\u7406&#8221;,\u7136\u540e\u641e\u4e86\u4e00\u5468,\u603b\u7ed3\u4e86\u4e00\u4e9b\u534f\u4f5c\u7684\u7ecf\u9a8c,\u5199\u5728\u8fd9\u91cc &hellip; <a href=\"https:\/\/7gugu.com\/index.php\/2019\/09\/23\/%e7%ac%94%e8%ae%b0git%e4%bd%bf%e7%94%a8%e6%80%bb%e7%bb%93\/\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">\u201c[\u7b14\u8bb0]Git\u4f7f\u7528\u603b\u7ed3\u201d<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[],"class_list":["post-432","post","type-post","status-publish","format-standard","hentry","category-13"],"_links":{"self":[{"href":"https:\/\/7gugu.com\/index.php\/wp-json\/wp\/v2\/posts\/432","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/7gugu.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/7gugu.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/7gugu.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/7gugu.com\/index.php\/wp-json\/wp\/v2\/comments?post=432"}],"version-history":[{"count":0,"href":"https:\/\/7gugu.com\/index.php\/wp-json\/wp\/v2\/posts\/432\/revisions"}],"wp:attachment":[{"href":"https:\/\/7gugu.com\/index.php\/wp-json\/wp\/v2\/media?parent=432"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/7gugu.com\/index.php\/wp-json\/wp\/v2\/categories?post=432"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/7gugu.com\/index.php\/wp-json\/wp\/v2\/tags?post=432"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}