{"id":19573,"date":"2024-11-19T16:23:20","date_gmt":"2024-11-19T08:23:20","guid":{"rendered":"https:\/\/fwq.ai\/blog\/19573\/"},"modified":"2024-11-19T16:23:20","modified_gmt":"2024-11-19T08:23:20","slug":"centos%e6%80%8e%e4%b9%88%e5%ae%89%e8%a3%85git%e5%ae%a2%e6%88%b7%e7%ab%af%ef%bc%88%e6%95%99%e7%a8%8b%ef%bc%89","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/19573\/","title":{"rendered":"CentOS\u600e\u4e48\u5b89\u88c5Git\u5ba2\u6237\u7aef\uff08\u6559\u7a0b\uff09"},"content":{"rendered":"<p>git\u662f\u4e00\u79cd\u5206\u5e03\u5f0f\u7248\u672c\u63a7\u5236\u7cfb\u7edf\uff0c\u88ab\u5e7f\u6cdb\u7528\u4e8e\u8f6f\u4ef6\u5f00\u53d1\u3002\u5728centos\u7cfb\u7edf\u4e2d\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528yum\u5b89\u88c5git\u670d\u52a1\u5668\uff0c\u4f46\u662f\u8981\u5728\u672c\u5730\u7535\u8111\u4e0a\u4f7f\u7528git\uff0c\u8fd8\u9700\u8981\u5b89\u88c5git\u5ba2\u6237\u7aef\u3002\u5728\u672c\u6587\u4e2d\uff0c\u6211\u4eec\u5c06\u4ecb\u7ecd\u5982\u4f55\u5728centos\u7cfb\u7edf\u4e0a\u5b89\u88c5git\u5ba2\u6237\u7aef\u3002<\/p>\n<p>\u6b65\u9aa4\u4e00\uff1a\u66f4\u65b0\u7cfb\u7edf<\/p>\n<p>\u4f7f\u7528Git\u5ba2\u6237\u7aef\u4e4b\u524d\uff0c\u5148\u8981\u66f4\u65b0\u5b89\u88c5CentOS\u7cfb\u7edf\u3002\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u66f4\u65b0\u7cfb\u7edf\uff1a<\/p>\n<pre>sudo yum update<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u6b65\u9aa4\u4e8c\uff1a\u5b89\u88c5Git\u5ba2\u6237\u7aef<\/p>\n<p>\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u5728CentOS\u4e0a\u5b89\u88c5Git\u5ba2\u6237\u7aef\uff1a<\/p>\n<pre>sudo yum install git<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u5728\u5b89\u88c5\u8fc7\u7a0b\u4e2d\uff0c\u4f1a\u51fa\u73b0\u63d0\u793a\uff0c\u8ba9\u60a8\u786e\u8ba4\u662f\u5426\u8981\u5b89\u88c5Git\u5ba2\u6237\u7aef\u3002\u5728\u63d0\u793a\u4e2d\u8f93\u5165\u201cy\u201d\uff0c\u7136\u540e\u6309\u56de\u8f66\u952e\u5373\u53ef\u3002<\/p>\n<p>\u6b65\u9aa4\u4e09\uff1a\u9a8c\u8bc1Git\u5ba2\u6237\u7aef\u662f\u5426\u5df2\u7ecf\u5b89\u88c5<\/p>\n<p>\u5b89\u88c5Git\u5ba2\u6237\u7aef\u4e4b\u540e\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u9a8c\u8bc1Git\u662f\u5426\u5b89\u88c5\u6210\u529f\uff1a<\/p>\n<pre>git --version<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u6b64\u547d\u4ee4\u5c06\u663e\u793a\u5b89\u88c5\u7684Git\u7248\u672c\u4fe1\u606f\uff0c\u5982\u679cGit\u5ba2\u6237\u7aef\u5df2\u7ecf\u5b89\u88c5\u6210\u529f\uff0c\u4f1a\u663e\u793aGit\u7684\u7248\u672c\u53f7\u3002<\/p>\n<p>\u6b65\u9aa4\u56db\uff1a\u914d\u7f6eGit\u7528\u6237\u540d\u548c\u7535\u5b50\u90ae\u4ef6\u5730\u5740<\/p>\n<p>\u5728\u4f7f\u7528Git\u4e4b\u524d\uff0c\u6211\u4eec\u9700\u8981\u914d\u7f6eGit\u7528\u6237\u540d\u548c\u7535\u5b50\u90ae\u4ef6\u5730\u5740\u3002\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u8bbe\u7f6e\u7528\u6237\u540d\u548c\u7535\u5b50\u90ae\u4ef6\u5730\u5740\uff1a<\/p>\n<pre>git config --global user.name \"\u4f60\u7684\u7528\u6237\u540d\"\ngit config --global user.email \"\u4f60\u7684\u7535\u5b50\u90ae\u4ef6\u5730\u5740\"<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u6b65\u9aa4\u4e94\uff1a\u4f7f\u7528Git\u5ba2\u6237\u7aef<\/p>\n<p>\u73b0\u5728\uff0c\u60a8\u5df2\u7ecf\u6210\u529f\u5730\u5728CentOS\u7cfb\u7edf\u4e0a\u5b89\u88c5\u4e86Git\u5ba2\u6237\u7aef\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5728\u5de5\u4f5c\u533a\u6216\u4ed3\u5e93\u4e2d\u4f7f\u7528Git\uff1a<\/p>\n<pre>git init                                                           # \u521d\u59cb\u5316Git\u4ed3\u5e93\ngit clone &lt;repository-url&gt;                                         # \u4ece\u8fdc\u7a0b\u4ed3\u5e93\u514b\u9686\u5230\u672c\u5730\ngit status                                                         # \u67e5\u770b\u5de5\u4f5c\u533a\u72b6\u6001\ngit add &lt;file&gt;                                                     # \u5c06\u6587\u4ef6\u6dfb\u52a0\u5230\u6682\u5b58\u533a\ngit commit -m \"\u63d0\u4ea4\u8bf4\u660e\"                                           # \u63d0\u4ea4\u4ee3\u7801\u5230\u672c\u5730\u4ed3\u5e93\ngit push &lt;remote&gt; &lt;branch&gt;                                         # \u5c06\u672c\u5730\u4ee3\u7801\u63a8\u9001\u5230\u8fdc\u7a0b\u4ed3\u5e93\ngit pull &lt;remote&gt; &lt;branch&gt;                                         # \u4ece\u8fdc\u7a0b\u4ed3\u5e93\u4e2d\u62c9\u53d6\u4ee3\u7801<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u603b\u7ed3<\/p>\n<p>\u5728CentOS\u7cfb\u7edf\u4e0a\u5b89\u88c5Git\u5ba2\u6237\u7aef\u662f\u4e00\u4e2a\u5f88\u7b80\u5355\u7684\u8fc7\u7a0b\uff0c\u53ea\u9700\u8981\u51e0\u4e2a\u547d\u4ee4\u5373\u53ef\u5b89\u88c5\u6210\u529f\u3002\u5b89\u88c5\u5b8c\u6210\u4e4b\u540e\uff0c\u60a8\u5c31\u53ef\u4ee5\u5728\u672c\u5730\u7535\u8111\u4e0a\u4f7f\u7528Git\u6765\u5b9e\u73b0\u7248\u672c\u63a7\u5236\u548c\u534f\u4f5c\u5f00\u53d1\u4e86\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662fCentOS\u600e\u4e48\u5b89\u88c5Git\u5ba2\u6237\u7aef\uff08\u6559\u7a0b\uff09\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>git\u662f\u4e00\u79cd\u5206\u5e03\u5f0f\u7248\u672c\u63a7\u5236\u7cfb\u7edf\uff0c\u88ab\u5e7f\u6cdb\u7528\u4e8e\u8f6f\u4ef6\u5f00\u53d1\u3002\u5728centos\u7cfb\u7edf\u4e2d\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528yum\u5b89\u88c5git\u670d\u52a1\u5668\uff0c\u4f46\u662f\u8981\u5728\u672c\u5730\u7535\u8111\u4e0a\u4f7f\u7528git\uff0c\u8fd8\u9700\u8981\u5b89\u88c5git\u5ba2\u6237\u7aef\u3002\u5728\u672c\u6587\u4e2d\uff0c\u6211\u4eec\u5c06\u4ecb\u7ecd\u5982\u4f55\u5728centos\u7cfb\u7edf\u4e0a\u5b89\u88c5git\u5ba2\u6237\u7aef\u3002 \u6b65\u9aa4\u4e00\uff1a\u66f4\u65b0\u7cfb\u7edf \u4f7f\u7528Git\u5ba2\u6237\u7aef\u4e4b\u524d\uff0c\u5148\u8981\u66f4\u65b0\u5b89\u88c5CentOS\u7cfb\u7edf\u3002\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u66f4\u65b0\u7cfb\u7edf\uff1a sudo yum update \u767b\u5f55\u540e\u590d\u5236 \u6b65\u9aa4\u4e8c\uff1a\u5b89\u88c5Git\u5ba2\u6237\u7aef \u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u5728CentOS\u4e0a\u5b89\u88c5Git\u5ba2\u6237\u7aef\uff1a sudo yum install git \u767b\u5f55\u540e\u590d\u5236 \u5728\u5b89\u88c5\u8fc7\u7a0b\u4e2d\uff0c\u4f1a\u51fa\u73b0\u63d0\u793a\uff0c\u8ba9\u60a8\u786e\u8ba4\u662f\u5426\u8981\u5b89\u88c5Git\u5ba2\u6237\u7aef\u3002\u5728\u63d0\u793a\u4e2d\u8f93\u5165\u201cy\u201d\uff0c\u7136\u540e\u6309\u56de\u8f66\u952e\u5373\u53ef\u3002 \u6b65\u9aa4\u4e09\uff1a\u9a8c\u8bc1Git\u5ba2\u6237\u7aef\u662f\u5426\u5df2\u7ecf\u5b89\u88c5 \u5b89\u88c5Git\u5ba2\u6237\u7aef\u4e4b\u540e\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u9a8c\u8bc1Git\u662f\u5426\u5b89\u88c5\u6210\u529f\uff1a git &#8211;version \u767b\u5f55\u540e\u590d\u5236 \u6b64\u547d\u4ee4\u5c06\u663e\u793a\u5b89\u88c5\u7684Git\u7248\u672c\u4fe1\u606f\uff0c\u5982\u679cGit\u5ba2\u6237\u7aef\u5df2\u7ecf\u5b89\u88c5\u6210\u529f\uff0c\u4f1a\u663e\u793aGit\u7684\u7248\u672c\u53f7\u3002 \u6b65\u9aa4\u56db\uff1a\u914d\u7f6eGit\u7528\u6237\u540d\u548c\u7535\u5b50\u90ae\u4ef6\u5730\u5740 \u5728\u4f7f\u7528Git\u4e4b\u524d\uff0c\u6211\u4eec\u9700\u8981\u914d\u7f6eGit\u7528\u6237\u540d\u548c\u7535\u5b50\u90ae\u4ef6\u5730\u5740\u3002\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u8bbe\u7f6e\u7528\u6237\u540d\u548c\u7535\u5b50\u90ae\u4ef6\u5730\u5740\uff1a git config &#8211;global user.name &#8220;\u4f60\u7684\u7528\u6237\u540d&#8221; git config &#8211;global user.email &#8220;\u4f60\u7684\u7535\u5b50\u90ae\u4ef6\u5730\u5740&#8221; \u767b\u5f55\u540e\u590d\u5236 \u6b65\u9aa4\u4e94\uff1a\u4f7f\u7528Git\u5ba2\u6237\u7aef \u73b0\u5728\uff0c\u60a8\u5df2\u7ecf\u6210\u529f\u5730\u5728CentOS\u7cfb\u7edf\u4e0a\u5b89\u88c5\u4e86Git\u5ba2\u6237\u7aef\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5728\u5de5\u4f5c\u533a\u6216\u4ed3\u5e93\u4e2d\u4f7f\u7528Git\uff1a git init # \u521d\u59cb\u5316Git\u4ed3\u5e93 git clone &lt;repository-url&gt; # \u4ece\u8fdc\u7a0b\u4ed3\u5e93\u514b\u9686\u5230\u672c\u5730 git status # \u67e5\u770b\u5de5\u4f5c\u533a\u72b6\u6001 git add &lt;file&gt; # \u5c06\u6587\u4ef6\u6dfb\u52a0\u5230\u6682\u5b58\u533a git [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-19573","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/19573","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=19573"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/19573\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=19573"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=19573"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=19573"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}