{"id":45482,"date":"2024-10-06T23:40:13","date_gmt":"2024-10-06T15:40:13","guid":{"rendered":"https:\/\/server.hk\/cnblog\/45482\/"},"modified":"2024-10-06T23:40:13","modified_gmt":"2024-10-06T15:40:13","slug":"%e6%9c%80%e5%b0%8f%e5%8c%96%e5%ae%89%e8%a3%9d%e7%9a%84-centos-7-5-%e4%b8%8a%e7%b7%a8%e8%ad%af%e5%ae%89%e8%a3%9d-git-2-19","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/45482\/","title":{"rendered":"\u6700\u5c0f\u5316\u5b89\u88dd\u7684 CentOS 7.5 \u4e0a\u7de8\u8b6f\u5b89\u88dd Git 2.19"},"content":{"rendered":"<h1 id=\"%e6%9c%80%e5%b0%8f%e5%8c%96%e5%ae%89%e8%a3%9d%e7%9a%84-centos-7-5-%e4%b8%8a%e7%b7%a8%e8%ad%af%e5%ae%89%e8%a3%9d-git-2-19-JKOTGMOicP\">\u6700\u5c0f\u5316\u5b89\u88dd\u7684 CentOS 7.5 \u4e0a\u7de8\u8b6f\u5b89\u88dd Git 2.19<\/h1>\n<p>\u5728\u7576\u4eca\u7684\u958b\u767c\u74b0\u5883\u4e2d\uff0c\u7248\u672c\u63a7\u5236\u7cfb\u7d71\u662f\u4e0d\u53ef\u6216\u7f3a\u7684\u5de5\u5177\uff0c\u800c Git \u4f5c\u70ba\u6700\u6d41\u884c\u7684\u7248\u672c\u63a7\u5236\u7cfb\u7d71\u4e4b\u4e00\uff0c\u5ee3\u6cdb\u61c9\u7528\u65bc\u5404\u7a2e\u958b\u767c\u9805\u76ee\u4e2d\u3002\u672c\u6587\u5c07\u4ecb\u7d39\u5982\u4f55\u5728\u6700\u5c0f\u5316\u5b89\u88dd\u7684 CentOS 7.5 \u4e0a\u7de8\u8b6f\u5b89\u88dd Git 2.19\uff0c\u5e6b\u52a9\u958b\u767c\u8005\u5728\u8f15\u91cf\u7d1a\u7684\u74b0\u5883\u4e2d\u9ad8\u6548\u4f7f\u7528 Git\u3002<\/p>\n<h2 id=\"%e5%89%8d%e6%9c%9f%e6%ba%96%e5%82%99-JKOTGMOicP\">\u524d\u671f\u6e96\u5099<\/h2>\n<p>\u5728\u958b\u59cb\u4e4b\u524d\uff0c\u78ba\u4fdd\u4f60\u7684 CentOS 7.5 \u7cfb\u7d71\u5df2\u7d93\u5b8c\u6210\u6700\u5c0f\u5316\u5b89\u88dd\uff0c\u4e26\u4e14\u53ef\u4ee5\u9023\u63a5\u5230\u4e92\u806f\u7db2\u3002\u63a5\u4e0b\u4f86\uff0c\u6211\u5011\u9700\u8981\u5b89\u88dd\u4e00\u4e9b\u5fc5\u8981\u7684\u4f9d\u8cf4\u5305\uff0c\u4ee5\u4fbf\u80fd\u5920\u7de8\u8b6f Git\u3002<\/p>\n<h3 id=\"%e5%ae%89%e8%a3%9d%e4%be%9d%e8%b3%b4%e5%8c%85-JKOTGMOicP\">\u5b89\u88dd\u4f9d\u8cf4\u5305<\/h3>\n<p>\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88dd\u7de8\u8b6f Git \u6240\u9700\u7684\u4f9d\u8cf4\u5305\uff1a<\/p>\n<pre><code>sudo yum groupinstall \"Development Tools\"\nsudo yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel<\/code><\/pre>\n<p>\u9019\u4e9b\u4f9d\u8cf4\u5305\u5305\u62ec\u4e86\u7de8\u8b6f\u5de5\u5177\u548c Git \u904b\u884c\u6240\u9700\u7684\u5eab\u6587\u4ef6\u3002<\/p>\n<h2 id=\"%e4%b8%8b%e8%bc%89-git-%e6%ba%90%e7%a2%bc-JKOTGMOicP\">\u4e0b\u8f09 Git \u6e90\u78bc<\/h2>\n<p>\u63a5\u4e0b\u4f86\uff0c\u6211\u5011\u9700\u8981\u5f9e\u5b98\u65b9\u7db2\u7ad9\u4e0b\u8f09 Git \u7684\u6e90\u78bc\u5305\u3002\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u4f86\u4e0b\u8f09 Git 2.19 \u7684\u6e90\u78bc\uff1a<\/p>\n<pre><code>wget https:\/\/github.com\/git\/git\/archive\/v2.19.0.tar.gz<\/code><\/pre>\n<p>\u4e0b\u8f09\u5b8c\u6210\u5f8c\uff0c\u89e3\u58d3\u7e2e\u6e90\u78bc\u5305\uff1a<\/p>\n<pre><code>tar -zxvf v2.19.0.tar.gz<\/code><\/pre>\n<h2 id=\"%e7%b7%a8%e8%ad%af%e5%92%8c%e5%ae%89%e8%a3%9d-git-JKOTGMOicP\">\u7de8\u8b6f\u548c\u5b89\u88dd Git<\/h2>\n<p>\u9032\u5165\u89e3\u58d3\u5f8c\u7684\u76ee\u9304\uff0c\u7136\u5f8c\u958b\u59cb\u7de8\u8b6f\u548c\u5b89\u88dd Git\uff1a<\/p>\n<pre><code>cd git-2.19.0\nmake prefix=\/usr\/local all\nsudo make prefix=\/usr\/local install<\/code><\/pre>\n<p>\u9019\u4e9b\u547d\u4ee4\u5c07\u6703\u7de8\u8b6f Git \u4e26\u5c07\u5176\u5b89\u88dd\u5230 \/usr\/local \u76ee\u9304\u4e0b\u3002<\/p>\n<h2 id=\"%e9%a9%97%e8%ad%89%e5%ae%89%e8%a3%9d-JKOTGMOicP\">\u9a57\u8b49\u5b89\u88dd<\/h2>\n<p>\u5b89\u88dd\u5b8c\u6210\u5f8c\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u4f86\u9a57\u8b49 Git \u662f\u5426\u5b89\u88dd\u6210\u529f\uff1a<\/p>\n<pre><code>git --version<\/code><\/pre>\n<p>\u5982\u679c\u5b89\u88dd\u6210\u529f\uff0c\u5c07\u6703\u986f\u793a Git \u7684\u7248\u672c\u865f\uff0c\u4f8b\u5982\uff1a<code>git version 2.19.0<\/code>\u3002<\/p>\n<h2 id=\"%e9%85%8d%e7%bd%ae-git-JKOTGMOicP\">\u914d\u7f6e Git<\/h2>\n<p>\u5b89\u88dd\u5b8c\u6210\u5f8c\uff0c\u5efa\u8b70\u9032\u884c\u57fa\u672c\u7684\u914d\u7f6e\uff0c\u4ee5\u4fbf\u66f4\u597d\u5730\u4f7f\u7528 Git\u3002\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u8a2d\u7f6e\u7528\u6236\u540d\u548c\u96fb\u5b50\u90f5\u4ef6\uff1a<\/p>\n<pre><code>git config --global user.name \"\u4f60\u7684\u540d\u5b57\"\ngit config --global user.email \"\u4f60\u7684\u90f5\u7bb1\"<\/code><\/pre>\n<p>\u9019\u4e9b\u914d\u7f6e\u5c07\u6703\u5e6b\u52a9 Git \u5728\u63d0\u4ea4\u6642\u6b63\u78ba\u5730\u986f\u793a\u4f5c\u8005\u4fe1\u606f\u3002<\/p>\n<h2 id=\"%e7%b8%bd%e7%b5%90-JKOTGMOicP\">\u7e3d\u7d50<\/h2>\n<p>\u5728\u6700\u5c0f\u5316\u5b89\u88dd\u7684 CentOS 7.5 \u4e0a\u7de8\u8b6f\u5b89\u88dd Git 2.19 \u7684\u904e\u7a0b\u76f8\u5c0d\u7c21\u55ae\uff0c\u53ea\u9700\u5b89\u88dd\u5fc5\u8981\u7684\u4f9d\u8cf4\u5305\uff0c\u4e0b\u8f09\u6e90\u78bc\uff0c\u7136\u5f8c\u9032\u884c\u7de8\u8b6f\u548c\u5b89\u88dd\u3002\u9019\u6a23\u7684\u74b0\u5883\u4e0d\u50c5\u8f15\u91cf\uff0c\u9084\u80fd\u5920\u63d0\u4f9b\u9ad8\u6548\u7684\u7248\u672c\u63a7\u5236\u529f\u80fd\u3002\u5c0d\u65bc\u9700\u8981\u5728\u9999\u6e2f\u9032\u884c\u958b\u767c\u7684\u5718\u968a\uff0c\u9078\u64c7\u5408\u9069\u7684 <a href=\"https:\/\/server.hk\">VPS<\/a> \u65b9\u6848\u53ef\u4ee5\u9032\u4e00\u6b65\u63d0\u5347\u958b\u767c\u6548\u7387\uff0c\u4e26\u78ba\u4fdd\u7a69\u5b9a\u7684\u904b\u884c\u74b0\u5883\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5b78\u7fd2\u5982\u4f55\u5728\u6700\u5c0f\u5316\u5b89\u88dd\u7684 CentOS 7.5 \u4e0a\u7de8\u8b6f\u5b89\u88dd Git 2.19\uff0c\u6b65\u9a5f\u7c21\u55ae\uff0c\u9069\u5408\u958b\u767c\u8005\u548c\u7cfb\u7d71\u7ba1\u7406\u54e1\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4924],"tags":[],"class_list":["post-45482","post","type-post","status-publish","format-standard","hentry","category-setup-tutorials"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/45482","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=45482"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/45482\/revisions"}],"predecessor-version":[{"id":45483,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/45482\/revisions\/45483"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=45482"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=45482"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=45482"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}