{"id":7826,"date":"2020-01-06T18:26:46","date_gmt":"2020-01-06T10:26:46","guid":{"rendered":"https:\/\/sdeno.com\/?p=7826"},"modified":"2020-05-29T00:56:37","modified_gmt":"2020-05-28T16:56:37","slug":"%e6%90%ad%e5%bb%bagit%e6%9c%8d%e5%8a%a1%e5%99%a8","status":"publish","type":"post","link":"https:\/\/sdeno.com\/?p=7826","title":{"rendered":"\u642d\u5efagit\u670d\u52a1\u5668"},"content":{"rendered":"<p>\u73af\u5883\u662fcentos 6<\/p>\n<p>\u300a<a href=\"https:\/\/sdeno.com\/?p=6269\" target=\"_blank\" rel=\"noopener\">git\u7b14\u8bb0<\/a>\u300b<\/p>\n<p>1\uff0c\u5148\u770b\u770b\u9632\u706b\u5899\u662f\u5426\u7981\u7528\u7aef\u53e3\u8981\u4e48\u628a\u9632\u706b\u5899\u5173\u6389<\/p>\n<p>2\uff0c\u5b89\u88c5\u4f9d\u8d56<\/p>\n<pre>yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel\r\nyum install gcc perl-ExtUtils-MakeMaker<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>3\uff0cgit\u4e0b\u8f7d\u5e76\u5b89\u88c5<\/p>\n<p>https:\/\/mirrors.edge.kernel.org\/pub\/software\/scm\/git\/<\/p>\n<pre>cd \/usr\/local\/src\r\nwget https:\/\/www.kernel.org\/pub\/software\/scm\/git\/git-2.10.0.tar.gz\r\n\r\n#\u89e3\u538b\u3001\u7f16\u8bd1\u548c\u5b89\u88c5\r\ntar -zvxf git-2.10.0.tar.gz\r\ncd git-2.10.0\r\nmake prefix=\/usr\/local\/git all\r\nmake prefix=\/usr\/local\/git install<\/pre>\n<p>&nbsp;<\/p>\n<p>\u6dfb\u52a0\u73af\u5883\u53d8\u91cf<\/p>\n<pre>echo 'export PATH=$PATH:\/usr\/local\/git\/bin' &gt;&gt; \/etc\/bashrc\r\nsource \/etc\/bashrc<\/pre>\n<p>&nbsp;<\/p>\n<p>\u67e5\u770b\u662f\u5426\u5b89\u88c5\u6210\u529f<\/p>\n<pre>git --version<\/pre>\n<p>&nbsp;<\/p>\n<p>4\uff0c\u521b\u5efagit\u8d26\u53f7\u5e76\u8bbe\u7f6e\u5bc6\u7801<\/p>\n<pre>useradd -m xgllseo\r\npasswd xgllseo<\/pre>\n<p>&nbsp;<\/p>\n<p>5\uff0c\u521b\u5efa\u4ed3\u5e93<\/p>\n<pre>mkdir -p \/home\/git\/repositories\/test.git\r\ncd \/home\/git\/repositories\/test.git\r\ngit --bare init\r\nchown -R root:root \/home\/git\/repositories\r\nchmod -R 777 \/home\/git\/repositories\/test.git<\/pre>\n<p>&nbsp;<\/p>\n<p>6\uff0c\u7528\u6237\u8fde\u63a5\u9650\u5236<\/p>\n<p>\u627e\u5230git-shell\u547d\u4ee4\u6240\u5728\u76ee\u5f55\uff0c\u6211\u7684\u662f\/usr\/local\/git\/bin<\/p>\n<p>\u7f16\u8f91vi \/etc\/passwd\uff0c\u6dfb\u52a0<\/p>\n<pre>git:x:500:500::\/home\/git:\/usr\/local\/git\/bin\/git-shell<\/pre>\n<p>&nbsp;<\/p>\n<p>7\uff0c\u5c1d\u8bd5\u62c9\u4e0b\u4ee3\u7801<\/p>\n<pre>\/\/\u521d\u59cb\u5316\u4e00\u4e2a\u7a7a\u767d\u4ed3\u5e93\r\ngit init \r\n\r\n\/\/\u7ed9\u672c\u5730\u4ed3\u5e93\u8bbe\u7f6e\u4e00\u4e2a\u8fdc\u7a0b\u4e0a\u4f20\u3001\u4e0b\u8f7d\u5730\u5740\u503c\u662fgit@xxx.git\uff0c\u8d4b\u503c\u5230\u4e00\u4e2a\u53d8\u91cf\u540d\u4e3aorigin\uff0c\uff08\u9ed8\u8ba4\u90fd\u662forigin\u4e0d\u63a8\u8350\u4e71\u53d6\u540d\uff09\r\ngit remote add origin git@gitee.com:chen77134056\/vuelic3.git  \r\n\r\n\/\/\u901a\u8fc7\u8bbe\u7f6e\u597d\u7684\u8fdc\u7a0b\u4ed3\u5e93,\u4e0b\u8f7d\u8fdc\u7a0b\u4ed3\u5e93\u7684\u5185\u5bb9,\u4f46\u662f\u8fd9\u4e2a\u547d\u4ee4\u4e0d\u4f1a\u5e2e\u6211\u4eec\u5408\u5e76\u4ee3\u7801\r\ngit fetch\r\n\r\n\/\/\u5c06\u672c\u5730\u5206\u652fmaster\u4e0e\u8fdc\u7a0b\u4ed3\u5e93\u5206\u652f\u5173\u8054\u5230\u4e00\u8d77\uff0c\u8fd9\u6837\u624d\u80fdgit push\uff08\u63a8\u8350\u672c\u5730\u5206\u652f\u53d6\u540d\u548c\u8fdc\u7a0b\u5206\u652f\u53d6\u540d\u4e00\u6837\uff09\r\ngit branch master origin\/master\r\n\r\n\/\/\u73b0\u5728\u5207\u6362master\u5206\u652f\r\ngit checkout master\r\n\r\n\/\/\u4e0b\u8f7d\u8fdc\u7a0b\u4ed3\u5e93\u7684\u5185\u5bb9\uff0c\u4f1a\u628a\u6211\u4eec\u81ea\u5df1\u4ee3\u7801\u548c\u8fdc\u7a0b\u4ee3\u7801\u5408\u5e76\u5728\u4e00\u8d77\r\ngit pull<\/pre>\n<p>&nbsp;<\/p>\n<p>\u8fd8\u6709\u4e00\u4e2a\u95ee\u9898\u5c31\u662f\u6bcf\u6b21git push\/pull\u90fd\u8981\u5bc6\u7801\u3002<\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/www.cnblogs.com\/007sx\/p\/6076151.html\" target=\"_blank\" rel=\"noopener\">https:\/\/www.cnblogs.com\/007sx\/p\/6076151.html<\/a><\/p>\n<p>&nbsp;<\/p>\n<p><audio style=\"display: none;\" controls=\"controls\"><\/audio><\/p>\n<p><audio style=\"display: none;\" controls=\"controls\"><\/audio><\/p>\n<p><audio style=\"display: none;\" controls=\"controls\"><\/audio><\/p>\n<p><audio style=\"display: none;\" controls=\"controls\"><\/audio><\/p>\n<p><audio style=\"display: none;\" controls=\"controls\"><\/audio><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u73af\u5883\u662fcentos 6 \u300agit\u7b14\u8bb0\u300b 1\uff0c\u5148\u770b\u770b\u9632\u706b\u5899\u662f\u5426\u7981\u7528\u7aef\u53e3\u8981\u4e48\u628a\u9632\u706b\u5899\u5173\u6389 2\uff0c\u5b89\u88c5\u4f9d\u8d56 yum i [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-7826","post","type-post","status-publish","format-standard","hentry","category-wordpress"],"_links":{"self":[{"href":"https:\/\/sdeno.com\/index.php?rest_route=\/wp\/v2\/posts\/7826","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sdeno.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sdeno.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sdeno.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sdeno.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7826"}],"version-history":[{"count":0,"href":"https:\/\/sdeno.com\/index.php?rest_route=\/wp\/v2\/posts\/7826\/revisions"}],"wp:attachment":[{"href":"https:\/\/sdeno.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7826"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sdeno.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7826"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sdeno.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7826"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}