{"id":19193,"date":"2024-11-19T17:49:16","date_gmt":"2024-11-19T09:49:16","guid":{"rendered":"https:\/\/fwq.ai\/blog\/19193\/"},"modified":"2024-11-19T17:49:16","modified_gmt":"2024-11-19T09:49:16","slug":"ubuntu%e4%b8%8a%e5%a6%82%e4%bd%95%e5%ae%89%e8%a3%85git","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/19193\/","title":{"rendered":"Ubuntu\u4e0a\u5982\u4f55\u5b89\u88c5Git"},"content":{"rendered":"<p>git\u662f\u4e00\u79cd\u5206\u5e03\u5f0f\u7248\u672c\u63a7\u5236\u5de5\u5177\uff0c\u662f\u5f00\u6e90\u8f6f\u4ef6\u5f00\u53d1\u8fc7\u7a0b\u4e2d\u5e38\u7528\u7684\u5de5\u5177\u4e4b\u4e00\u3002\u5728ubuntu\u7cfb\u7edf\u4e2d\u5b89\u88c5git\u5341\u5206\u7b80\u5355\u3002\u672c\u7bc7\u6587\u7ae0\u5c06\u4e3a\u5927\u5bb6\u4ecb\u7ecd\u5982\u4f55\u5728ubuntu\u7cfb\u7edf\u4e2d\u5b89\u88c5git\u3002<\/p>\n<p>1.\u6253\u5f00\u7ec8\u7aef<\/p>\n<p>\u5728Ubuntu\u7cfb\u7edf\u4e2d\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u7ec8\u7aef\u8f93\u5165\u547d\u4ee4\u8fdb\u884c\u64cd\u4f5c\u3002\u6253\u5f00\u7ec8\u7aef\u7684\u5feb\u6377\u952e\u4e3aCtrl+Alt+T\u3002<\/p>\n<p>2.\u5b89\u88c5Git<\/p>\n<p>\u5728\u7ec8\u7aef\u4e2d\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff0c\u5373\u53ef\u5f00\u59cb\u5b89\u88c5Git\u3002<\/p>\n<pre>sudo apt-get install git<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u5b89\u88c5\u8fc7\u7a0b\u4e2d\u9700\u8981\u8f93\u5165\u7ba1\u7406\u5458\u5bc6\u7801\uff0c\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u7ec8\u7aef\u4f1a\u8f93\u51faGit\u7684\u7248\u672c\u53f7\u7b49\u4fe1\u606f\u3002<\/p>\n<p>3.\u9a8c\u8bc1Git\u662f\u5426\u5b89\u88c5\u6210\u529f<\/p>\n<p>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u68c0\u9a8cGit\u662f\u5426\u5df2\u7ecf\u6210\u529f\u5b89\u88c5\u3002<\/p>\n<pre>git --version<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u5982\u679c\u7ec8\u7aef\u8f93\u51fa\u4ee5\u4e0b\u4fe1\u606f\uff0c\u5219\u8bf4\u660eGit\u5df2\u7ecf\u5b89\u88c5\u6210\u529f\u3002<\/p>\n<p>4.\u8bbe\u7f6eGit\u7684\u5168\u5c40\u914d\u7f6e<\/p>\n<p>\u5728\u4f7f\u7528Git\u524d\uff0c\u6211\u4eec\u9700\u8981\u5148\u5bf9Git\u8fdb\u884c\u4e00\u4e9b\u57fa\u672c\u7684\u914d\u7f6e\u3002\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u8fdb\u884c\u7528\u6237\u540d\u548cEmail\u7684\u914d\u7f6e\u3002\u8bf7\u5c06username\u548cemail\u66ff\u6362\u6210\u4f60\u81ea\u5df1\u7684\u7528\u6237\u540d\u548cEmail\u3002<\/p>\n<pre>git config --global user.name \"username\"\n\ngit config --global user.email \"email\"<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u914d\u7f6e\u5b8c\u6210\u540e\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u68c0\u67e5\u914d\u7f6e\u662f\u5426\u751f\u6548\u3002<\/p>\n<pre>git config --list<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>5.\u603b\u7ed3<\/p>\n<p>\u672c\u7bc7\u6587\u7ae0\u4e3a\u5927\u5bb6\u4ecb\u7ecd\u4e86\u5728Ubuntu\u7cfb\u7edf\u4e2d\u5b89\u88c5Git\u7684\u8fc7\u7a0b\uff0c\u5305\u62ec\u4e86\u6253\u5f00\u7ec8\u7aef\u3001\u5b89\u88c5Git\u3001\u9a8c\u8bc1Git\u662f\u5426\u5b89\u88c5\u6210\u529f\u3001\u8bbe\u7f6eGit\u7684\u5168\u5c40\u914d\u7f6e\u7b49\u5185\u5bb9\u3002\u5e0c\u671b\u5bf9\u5927\u5bb6\u6709\u6240\u5e2e\u52a9\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662fUbuntu\u4e0a\u5982\u4f55\u5b89\u88c5Git\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\u5de5\u5177\uff0c\u662f\u5f00\u6e90\u8f6f\u4ef6\u5f00\u53d1\u8fc7\u7a0b\u4e2d\u5e38\u7528\u7684\u5de5\u5177\u4e4b\u4e00\u3002\u5728ubuntu\u7cfb\u7edf\u4e2d\u5b89\u88c5git\u5341\u5206\u7b80\u5355\u3002\u672c\u7bc7\u6587\u7ae0\u5c06\u4e3a\u5927\u5bb6\u4ecb\u7ecd\u5982\u4f55\u5728ubuntu\u7cfb\u7edf\u4e2d\u5b89\u88c5git\u3002 1.\u6253\u5f00\u7ec8\u7aef \u5728Ubuntu\u7cfb\u7edf\u4e2d\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u7ec8\u7aef\u8f93\u5165\u547d\u4ee4\u8fdb\u884c\u64cd\u4f5c\u3002\u6253\u5f00\u7ec8\u7aef\u7684\u5feb\u6377\u952e\u4e3aCtrl+Alt+T\u3002 2.\u5b89\u88c5Git \u5728\u7ec8\u7aef\u4e2d\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff0c\u5373\u53ef\u5f00\u59cb\u5b89\u88c5Git\u3002 sudo apt-get install git \u767b\u5f55\u540e\u590d\u5236 \u5b89\u88c5\u8fc7\u7a0b\u4e2d\u9700\u8981\u8f93\u5165\u7ba1\u7406\u5458\u5bc6\u7801\uff0c\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u7ec8\u7aef\u4f1a\u8f93\u51faGit\u7684\u7248\u672c\u53f7\u7b49\u4fe1\u606f\u3002 3.\u9a8c\u8bc1Git\u662f\u5426\u5b89\u88c5\u6210\u529f \u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u68c0\u9a8cGit\u662f\u5426\u5df2\u7ecf\u6210\u529f\u5b89\u88c5\u3002 git &#8211;version \u767b\u5f55\u540e\u590d\u5236 \u5982\u679c\u7ec8\u7aef\u8f93\u51fa\u4ee5\u4e0b\u4fe1\u606f\uff0c\u5219\u8bf4\u660eGit\u5df2\u7ecf\u5b89\u88c5\u6210\u529f\u3002 4.\u8bbe\u7f6eGit\u7684\u5168\u5c40\u914d\u7f6e \u5728\u4f7f\u7528Git\u524d\uff0c\u6211\u4eec\u9700\u8981\u5148\u5bf9Git\u8fdb\u884c\u4e00\u4e9b\u57fa\u672c\u7684\u914d\u7f6e\u3002\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u8fdb\u884c\u7528\u6237\u540d\u548cEmail\u7684\u914d\u7f6e\u3002\u8bf7\u5c06username\u548cemail\u66ff\u6362\u6210\u4f60\u81ea\u5df1\u7684\u7528\u6237\u540d\u548cEmail\u3002 git config &#8211;global user.name &#8220;username&#8221; git config &#8211;global user.email &#8220;email&#8221; \u767b\u5f55\u540e\u590d\u5236 \u914d\u7f6e\u5b8c\u6210\u540e\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u68c0\u67e5\u914d\u7f6e\u662f\u5426\u751f\u6548\u3002 git config &#8211;list \u767b\u5f55\u540e\u590d\u5236 5.\u603b\u7ed3 \u672c\u7bc7\u6587\u7ae0\u4e3a\u5927\u5bb6\u4ecb\u7ecd\u4e86\u5728Ubuntu\u7cfb\u7edf\u4e2d\u5b89\u88c5Git\u7684\u8fc7\u7a0b\uff0c\u5305\u62ec\u4e86\u6253\u5f00\u7ec8\u7aef\u3001\u5b89\u88c5Git\u3001\u9a8c\u8bc1Git\u662f\u5426\u5b89\u88c5\u6210\u529f\u3001\u8bbe\u7f6eGit\u7684\u5168\u5c40\u914d\u7f6e\u7b49\u5185\u5bb9\u3002\u5e0c\u671b\u5bf9\u5927\u5bb6\u6709\u6240\u5e2e\u52a9\u3002 \u4ee5\u4e0a\u5c31\u662fUbuntu\u4e0a\u5982\u4f55\u5b89\u88c5Git\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/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-19193","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/19193","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=19193"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/19193\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=19193"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=19193"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=19193"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}