{"id":19209,"date":"2024-11-19T17:07:03","date_gmt":"2024-11-19T09:07:03","guid":{"rendered":"https:\/\/fwq.ai\/blog\/19209\/"},"modified":"2024-11-19T17:07:03","modified_gmt":"2024-11-19T09:07:03","slug":"xcode%e4%b8%ad%e6%80%8e%e4%b9%88%e9%85%8d%e7%bd%aegit","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/19209\/","title":{"rendered":"Xcode\u4e2d\u600e\u4e48\u914d\u7f6eGit"},"content":{"rendered":"<p>xcode\u662fmac\u5e73\u53f0\u4e0a\u7684\u4e00\u4e2a\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08ide\uff09\uff0c\u5b83\u5305\u542b\u4e86\u4e00\u5957\u529f\u80fd\u5f3a\u5927\u7684\u5de5\u5177\u96c6\uff0c\u652f\u6301ios\u548cmacos\u5e94\u7528\u7a0b\u5e8f\u7684\u5f00\u53d1\u3002\u5728\u8fdb\u884cios\u548cmacos\u5f00\u53d1\u65f6\uff0c\u7ecf\u5e38\u4f1a\u7528\u5230\u7248\u672c\u63a7\u5236\u5de5\u5177git\uff0c\u56e0\u6b64\uff0c\u5b89\u88c5git\u662fxcode\u4e2d\u5fc5\u4e0d\u53ef\u5c11\u7684\u4e00\u6b65\u3002<\/p>\n<p>\u672c\u6587\u5c06\u4ecb\u7ecd\u5982\u4f55\u5728Mac\u4e0a\u4f7f\u7528Homebrew\u5b89\u88c5Git\uff0c\u4ee5\u53ca\u5728Xcode\u4e2d\u914d\u7f6eGit\u3002<\/p>\n<h2>\u5b89\u88c5Git<\/h2>\n<h3>\u65b9\u6cd5\u4e00\uff1a\u4f7f\u7528Homebrew\u5b89\u88c5<\/h3>\n<p>Homebrew\u662fMac\u4e0a\u7684\u8f6f\u4ef6\u5305\u7ba1\u7406\u5668\uff0c\u53ef\u4ee5\u65b9\u4fbf\u5730\u5b89\u88c5\u548c\u7ba1\u7406\u5404\u79cd\u8f6f\u4ef6\u5305\u3002\u5b89\u88c5Homebrew\u540e\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5728\u7ec8\u7aef\u4e2d\u5b89\u88c5Git\uff1a<\/p>\n<pre>brew install git<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<h3>\u65b9\u6cd5\u4e8c\uff1a\u4e0b\u8f7d\u5b89\u88c5\u5305\u5b89\u88c5<\/h3>\n<p>\u4f60\u4e5f\u53ef\u4ee5\u4eceGit\u5b98\u65b9\u7f51\u7ad9\u4e0b\u8f7d\u5b89\u88c5\u5305\u5e76\u624b\u52a8\u5b89\u88c5\u3002\u8bbf\u95ee[https:\/\/git-scm.com\/download\/mac\uff0c](https:\/\/git-scm.com\/download\/mac)\u4e0b\u8f7d.dmg\u6587\u4ef6\uff0c\u53cc\u51fb\u6253\u5f00\u5e76\u6309\u7167\u5b89\u88c5\u5411\u5bfc\u8fdb\u884c\u64cd\u4f5c\u3002<\/p>\n<h2>\u914d\u7f6eGit<\/h2>\n<p>\u5728Mac\u4e0a\u5b89\u88c5\u5b8c\u6210Git\u540e\uff0c\u4f60\u9700\u8981\u5728Xcode\u4e2d\u914d\u7f6eGit\u3002<\/p>\n<ol>\n<li>\u6253\u5f00Xcode\uff0c\u8fdb\u5165\u201cPreferences\u201d\uff08\u504f\u597d\u8bbe\u7f6e\uff09\u3002<\/li>\n<li>\u70b9\u51fb\u201cLocations\u201d\uff0c\u627e\u5230\u201cCommand Line Tools\u201d\uff0c\u9009\u62e9\u5b89\u88c5\u7684Git\u7248\u672c\u3002<\/li>\n<li>\u7136\u540e\uff0c\u5728\u7ec8\u7aef\u4e2d\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u914d\u7f6eGit\u4fe1\u606f\uff1a<\/li>\n<\/ol>\n<pre>git config --global user.name \"Your Name\"\ngit config --global user.email \"you@example.com\"<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u5176\u4e2d\uff0c\u201cYour Name\u201d\u662f\u4f60\u7684\u540d\u5b57\uff0c\u201cyou@example.com\u201d\u662f\u4f60\u7684\u7535\u5b50\u90ae\u4ef6\u5730\u5740\u3002\u8fd9\u4e2a\u547d\u4ee4\u4f1a\u5728\u5168\u5c40\u8303\u56f4\u5185\u8bbe\u7f6eGit\u7684\u7528\u6237\u540d\u548c\u7535\u5b50\u90ae\u4ef6\uff0c\u4ee5\u4fbf\u5728\u63d0\u4ea4\u4ee3\u7801\u65f6\u8fdb\u884c\u6807\u8bc6\u3002<\/p>\n<p>\u5230\u6b64\uff0c\u4f60\u5df2\u7ecf\u6210\u529f\u5b89\u88c5\u548c\u914d\u7f6e\u4e86Git\uff0c\u5e76\u53ef\u4ee5\u5728Xcode\u4e2d\u4f7f\u7528Git\u6765\u7ba1\u7406\u4f60\u7684\u4ee3\u7801\u7248\u672c\u5566\uff01<\/p>\n<h2>\u603b\u7ed3<\/h2>\n<p>\u5b89\u88c5Git\u662f\u8fdb\u884ciOS\u548cmacOS\u5e94\u7528\u7a0b\u5e8f\u5f00\u53d1\u7684\u5fc5\u5907\u6b65\u9aa4\u3002\u5728\u672c\u6587\u4e2d\uff0c\u6211\u4eec\u4ecb\u7ecd\u4e86\u4e24\u79cd\u5728Mac\u4e0a\u5b89\u88c5Git\u7684\u65b9\u6cd5\uff1a\u4f7f\u7528Homebrew\u548c\u624b\u52a8\u4e0b\u8f7d\u5b89\u88c5\u5305\u3002\u540c\u65f6\uff0c\u6211\u4eec\u8fd8\u5411\u4f60\u6f14\u793a\u4e86\u5982\u4f55\u5728Xcode\u4e2d\u914d\u7f6eGit\u3002\u5e0c\u671b\u672c\u6587\u53ef\u4ee5\u5e2e\u52a9\u4f60\u66f4\u597d\u5730\u7ba1\u7406\u4f60\u7684\u4ee3\u7801\u7248\u672c\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662fXcode\u4e2d\u600e\u4e48\u914d\u7f6eGit\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>xcode\u662fmac\u5e73\u53f0\u4e0a\u7684\u4e00\u4e2a\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08ide\uff09\uff0c\u5b83\u5305\u542b\u4e86\u4e00\u5957\u529f\u80fd\u5f3a\u5927\u7684\u5de5\u5177\u96c6\uff0c\u652f\u6301ios\u548cmacos\u5e94\u7528\u7a0b\u5e8f\u7684\u5f00\u53d1\u3002\u5728\u8fdb\u884cios\u548cmacos\u5f00\u53d1\u65f6\uff0c\u7ecf\u5e38\u4f1a\u7528\u5230\u7248\u672c\u63a7\u5236\u5de5\u5177git\uff0c\u56e0\u6b64\uff0c\u5b89\u88c5git\u662fxcode\u4e2d\u5fc5\u4e0d\u53ef\u5c11\u7684\u4e00\u6b65\u3002 \u672c\u6587\u5c06\u4ecb\u7ecd\u5982\u4f55\u5728Mac\u4e0a\u4f7f\u7528Homebrew\u5b89\u88c5Git\uff0c\u4ee5\u53ca\u5728Xcode\u4e2d\u914d\u7f6eGit\u3002 \u5b89\u88c5Git \u65b9\u6cd5\u4e00\uff1a\u4f7f\u7528Homebrew\u5b89\u88c5 Homebrew\u662fMac\u4e0a\u7684\u8f6f\u4ef6\u5305\u7ba1\u7406\u5668\uff0c\u53ef\u4ee5\u65b9\u4fbf\u5730\u5b89\u88c5\u548c\u7ba1\u7406\u5404\u79cd\u8f6f\u4ef6\u5305\u3002\u5b89\u88c5Homebrew\u540e\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5728\u7ec8\u7aef\u4e2d\u5b89\u88c5Git\uff1a brew install git \u767b\u5f55\u540e\u590d\u5236 \u65b9\u6cd5\u4e8c\uff1a\u4e0b\u8f7d\u5b89\u88c5\u5305\u5b89\u88c5 \u4f60\u4e5f\u53ef\u4ee5\u4eceGit\u5b98\u65b9\u7f51\u7ad9\u4e0b\u8f7d\u5b89\u88c5\u5305\u5e76\u624b\u52a8\u5b89\u88c5\u3002\u8bbf\u95ee[https:\/\/git-scm.com\/download\/mac\uff0c](https:\/\/git-scm.com\/download\/mac)\u4e0b\u8f7d.dmg\u6587\u4ef6\uff0c\u53cc\u51fb\u6253\u5f00\u5e76\u6309\u7167\u5b89\u88c5\u5411\u5bfc\u8fdb\u884c\u64cd\u4f5c\u3002 \u914d\u7f6eGit \u5728Mac\u4e0a\u5b89\u88c5\u5b8c\u6210Git\u540e\uff0c\u4f60\u9700\u8981\u5728Xcode\u4e2d\u914d\u7f6eGit\u3002 \u6253\u5f00Xcode\uff0c\u8fdb\u5165\u201cPreferences\u201d\uff08\u504f\u597d\u8bbe\u7f6e\uff09\u3002 \u70b9\u51fb\u201cLocations\u201d\uff0c\u627e\u5230\u201cCommand Line Tools\u201d\uff0c\u9009\u62e9\u5b89\u88c5\u7684Git\u7248\u672c\u3002 \u7136\u540e\uff0c\u5728\u7ec8\u7aef\u4e2d\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u914d\u7f6eGit\u4fe1\u606f\uff1a git config &#8211;global user.name &#8220;Your Name&#8221; git config &#8211;global user.email &#8220;you@example.com&#8221; \u767b\u5f55\u540e\u590d\u5236 \u5176\u4e2d\uff0c\u201cYour Name\u201d\u662f\u4f60\u7684\u540d\u5b57\uff0c\u201cyou@example.com\u201d\u662f\u4f60\u7684\u7535\u5b50\u90ae\u4ef6\u5730\u5740\u3002\u8fd9\u4e2a\u547d\u4ee4\u4f1a\u5728\u5168\u5c40\u8303\u56f4\u5185\u8bbe\u7f6eGit\u7684\u7528\u6237\u540d\u548c\u7535\u5b50\u90ae\u4ef6\uff0c\u4ee5\u4fbf\u5728\u63d0\u4ea4\u4ee3\u7801\u65f6\u8fdb\u884c\u6807\u8bc6\u3002 \u5230\u6b64\uff0c\u4f60\u5df2\u7ecf\u6210\u529f\u5b89\u88c5\u548c\u914d\u7f6e\u4e86Git\uff0c\u5e76\u53ef\u4ee5\u5728Xcode\u4e2d\u4f7f\u7528Git\u6765\u7ba1\u7406\u4f60\u7684\u4ee3\u7801\u7248\u672c\u5566\uff01 \u603b\u7ed3 \u5b89\u88c5Git\u662f\u8fdb\u884ciOS\u548cmacOS\u5e94\u7528\u7a0b\u5e8f\u5f00\u53d1\u7684\u5fc5\u5907\u6b65\u9aa4\u3002\u5728\u672c\u6587\u4e2d\uff0c\u6211\u4eec\u4ecb\u7ecd\u4e86\u4e24\u79cd\u5728Mac\u4e0a\u5b89\u88c5Git\u7684\u65b9\u6cd5\uff1a\u4f7f\u7528Homebrew\u548c\u624b\u52a8\u4e0b\u8f7d\u5b89\u88c5\u5305\u3002\u540c\u65f6\uff0c\u6211\u4eec\u8fd8\u5411\u4f60\u6f14\u793a\u4e86\u5982\u4f55\u5728Xcode\u4e2d\u914d\u7f6eGit\u3002\u5e0c\u671b\u672c\u6587\u53ef\u4ee5\u5e2e\u52a9\u4f60\u66f4\u597d\u5730\u7ba1\u7406\u4f60\u7684\u4ee3\u7801\u7248\u672c\u3002 \u4ee5\u4e0a\u5c31\u662fXcode\u4e2d\u600e\u4e48\u914d\u7f6eGit\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-19209","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/19209","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=19209"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/19209\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=19209"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=19209"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=19209"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}