{"id":11341,"date":"2023-06-13T12:51:53","date_gmt":"2023-06-13T04:51:53","guid":{"rendered":"http:\/\/123.57.164.21\/?p=11341"},"modified":"2023-06-13T12:51:53","modified_gmt":"2023-06-13T04:51:53","slug":"git%e5%af%86%e7%a0%81%ef%bc%88%e7%99%bb%e5%bd%95%e5%87%ad%e8%af%81%ef%bc%89%e7%9a%84%e4%bf%9d%e5%ad%98%e5%92%8c%e9%87%8d%e7%bd%ae-mac","status":"publish","type":"post","link":"https:\/\/92it.top\/?p=11341","title":{"rendered":"Git\u5bc6\u7801\uff08\u767b\u5f55\u51ed\u8bc1\uff09\u7684\u4fdd\u5b58\u548c\u91cd\u7f6e Mac"},"content":{"rendered":"\n<p><strong>\u80cc\u666f<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>git\u6709\u65f6\u9700\u8981\u7528\u6237\u63d0\u4f9b\u51ed\u636e\u624d\u80fd\u64cd\u4f5c\uff0c\u6bd4\u5982\u4e00\u822c\u516c\u53f8\u7684git\u670d\u52a1\u5668\u50cfgitlab\u7b49\u90fd\u4f1a\u9700\u8981\u63d0\u4f9b\u7528\u6237\u540d\u548c\u5bc6\u7801\u624d\u80fd\u8bbf\u95ee\uff0c\u4f46\u662f\u6bcf\u6b21\u66f4\u65b0\u6216\u63d0\u4ea4\u4ee3\u7801\u90fd\u8981\u6c42\u8f93\u5165\u4e00\u904d\u7528\u6237\u540d\u5bc6\u7801\u5b9e\u5728\u7e41\u7410\uff0c\u672c\u6587\u4e3b\u8981\u4ecb\u7ecd\u4e00\u4e0b\u5728macOS\u4e0b\u5982\u4f55\u907f\u514d\u8fd9\u79cd\u9891\u7e41\u7684\u91cd\u590d\u8f93\u5165\u3002<\/p>\n\n\n\n<p>\u4e4b\u524d\u914d\u7f6e\u7684<code>store<\/code>\u65b9\u5f0f\u7528\u4e8e\u5b58\u50a8\u7528\u6237\u540d\u53ca\u5bc6\u7801\uff0c\u4f46\u662f\u6700\u8fd1\u5347\u7ea7\u4e86\u4e00\u4e0bgit\u7248\u672c\uff0c\u53d1\u73b0\u8bb0\u4f4f\u5bc6\u7801\u529f\u80fd\u5931\u6548\u4e86\uff0c\u53c8\u5f00\u59cb\u8981\u6c42\u8f93\u5165\u7528\u6237\u540d\u53ca\u5bc6\u7801\uff0c\u4e8e\u662f\u8d76\u7d27\u68c0\u67e5\u4e86\u4e00\u4e0b\u914d\u7f6e\uff0c\u53d1\u73b0<code>credential.helper<\/code>\u7684\u503c\u53d8\u6210\u4e86<code>osxkeychain<\/code>,\u800c\u4e14\u5373\u4f7f\u8f93\u5165\u4e86\u4e5f\u65e0\u6cd5\u8bb0\u4f4f\u5bc6\u7801,\u539f\u672c\u5f88\u7b80\u5355\u7684\u4e8b\u60c5\uff0c\u5ffd\u7136\u611f\u89c9\u590d\u6742\u4e86\uff0c\u7d22\u6027\u8d81\u6b64\u4e86\u89e3\u4e00\u4e0b\u3002<\/p>\n\n\n\n<p><strong>\u51ed\u8bc1\u7cfb\u7edf<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>\u901a\u8fc7Git\u8fdb\u884c\u8fdc\u7a0b\u8bbf\u95ee\u65f6\uff0c\u9ed8\u8ba4\u6bcf\u6b21\u90fd\u4f1a\u8981\u6c42\u8f93\u5165\u7528\u6237\u540d\u548c\u5bc6\u7801\u3002\u8981\u60f3\u5bf9\u5bc6\u7801\u8fdb\u884c\u4fdd\u5b58\uff0c\u9700\u8981\u501f\u52a9git\u7684\u51ed\u8bc1\u7cfb\u7edf\u3002git\u652f\u6301\u56db\u79cd\u5f62\u5f0f\u7684\u51ed\u8bc1\u6a21\u5f0f\uff1a<\/p>\n\n\n\n<ul><li>\u201ccache\u201d \u6a21\u5f0f\u4f1a\u5c06\u51ed\u8bc1\u5b58\u653e\u5728\u5185\u5b58\u4e2d\u4e00\u6bb5\u65f6\u95f4\u3002 \u5bc6\u7801\u6c38\u8fdc\u4e0d\u4f1a\u88ab\u5b58\u50a8\u5728\u78c1\u76d8\u4e2d\uff0c\u5e76\u4e14\u572815\u5206\u949f\u540e\u4ece\u5185\u5b58\u4e2d\u6e05\u9664\u3002<\/li><li>\u201cstore\u201d \u6a21\u5f0f\u4f1a\u5c06\u51ed\u8bc1\u7528\u660e\u6587\u7684\u5f62\u5f0f\u5b58\u653e\u5728\u78c1\u76d8\u4e2d\uff0c\u5e76\u4e14\u6c38\u4e0d\u8fc7\u671f\u3002 \u8fd9\u610f\u5473\u7740\u9664\u975e\u4f60\u4fee\u6539\u4e86\u4f60\u5728 Git \u670d\u52a1\u5668\u4e0a\u7684\u5bc6\u7801\uff0c\u5426\u5219\u4f60\u6c38\u8fdc\u4e0d\u9700\u8981\u518d\u6b21\u8f93\u5165\u4f60\u7684\u51ed\u8bc1\u4fe1\u606f\u3002 \u8fd9\u79cd\u65b9\u5f0f\u7684\u7f3a\u70b9\u662f\u4f60\u7684\u5bc6\u7801\u662f\u7528\u660e\u6587\u7684\u65b9\u5f0f\u5b58\u653e\u5728\u4f60\u7684 home \u76ee\u5f55\u4e0b\u3002<\/li><li>\u5982\u679c\u4f60\u4f7f\u7528\u7684\u662f Mac\uff0cGit \u8fd8\u6709\u4e00\u79cd \u201cosxkeychain\u201d \u6a21\u5f0f\uff0c\u5b83\u4f1a\u5c06\u51ed\u8bc1\u7f13\u5b58\u5230\u4f60\u7cfb\u7edf\u7528\u6237\u7684\u94a5\u5319\u4e32\u4e2d\u3002 \u8fd9\u79cd\u65b9\u5f0f\u5c06\u51ed\u8bc1\u5b58\u653e\u5728\u78c1\u76d8\u4e2d\uff0c\u5e76\u4e14\u6c38\u4e0d\u8fc7\u671f\uff0c\u4f46\u662f\u662f\u88ab\u52a0\u5bc6\u7684\uff0c\u8fd9\u79cd\u52a0\u5bc6\u65b9\u5f0f\u4e0e\u5b58\u653e HTTPS \u51ed\u8bc1\u4ee5\u53ca Safari \u7684\u81ea\u52a8\u586b\u5199\u662f\u76f8\u540c\u7684\u3002<\/li><li>\u5982\u679c\u4f60\u4f7f\u7528\u7684\u662f Windows\uff0c\u4f60\u53ef\u4ee5\u5b89\u88c5\u4e00\u4e2a\u53eb\u505a \u201cGit Credential Manager for Windows\u201d \u7684\u8f85\u52a9\u5de5\u5177\u3002 \u8fd9\u548c\u4e0a\u9762\u8bf4\u7684 \u201cosxkeychain\u201d \u5341\u5206\u7c7b\u4f3c\uff0c\u4f46\u662f\u662f\u4f7f\u7528 Windows Credential Store \u6765\u63a7\u5236\u654f\u611f\u4fe1\u606f\u3002<br><\/li><\/ul>\n\n\n\n<p>\u51ed\u8bc1\u7cfb\u7edf\u548c Git \u672c\u8eab\u662f\u5206\u5f00\u7684\uff1b\u6bcf\u79cd\u51ed\u8bc1\u6a21\u5f0f\u90fd\u5bf9\u5e94\u4e00\u4e2a\u51ed\u8bc1\u8f85\u52a9\u5de5\u5177\u6765\u5bf9\u7528\u6237\u540d\u3001\u5bc6\u7801\u8fdb\u884c\u5904\u7406\u3002<\/p>\n\n\n\n<p><strong>\u68c0\u67e5\u672c\u5730\u53ef\u7528\u7684\u51ed\u636e\u52a9\u624b<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>\u5bc6\u7801\u4fdd\u5b58\u529f\u80fd\u4e3b\u8981\u662f\u501f\u52a9\u5916\u90e8\u51ed\u636e\u52a9\u624b\uff0c\u8fd9\u4e2a\u52a9\u624b\u7684\u4f5c\u7528\u5c31\u662f\u5728git\u670d\u52a1\u5668\uff08\u4e00\u822c\u662f\u901a\u8fc7http\/https\u8bbf\u95ee\u7684URL\uff09\u9700\u8981\u7528\u6237\u540d\u548c\u5bc6\u7801\u65f6\uff0c\u5b83\u53ef\u4ee5\u63d0\u4f9b\u8be5\u4fe1\u606f\uff0c\u800c\u8fd9\u79cd\u51ed\u636e\u52a9\u624b\u4e5f\u6709\u5f88\u591a\uff0c\u4e3b\u8981\u662f\u901a\u8fc7<code>credential.helper<\/code>\u5c5e\u6027\u6765\u6307\u5b9a\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$ git help -a | grep credential-\n   credential-cache     Helper to temporarily store passwords in memory\n   credential-store     Helper to store credentials on disk\n   credential-osxkeychain<\/pre>\n\n\n\n<p>\u53ef\u4ee5\u770b\u5230\uff0c\u672c\u5730\u9ed8\u8ba4\u67093\u4e2a\u52a9\u624b\u53ef\u9009\uff0c\u5206\u522b\u4e3a<code>credential-cache<\/code>\uff0c<code>credential-store<\/code>\uff0c<code>credential-osxkeychain<\/code>\u3002<\/p>\n\n\n\n<p><strong>\u51ed\u636e\u52a9\u624b\u7528\u6cd5<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>\u76f4\u63a5\u4f7f\u7528\u4e0a\u8ff0\u7684\u52a9\u624b\u4e2d<code>credential-<\/code>\u540e\u8fb9\u7684\u90e8\u5206\uff0c\u4f8b\u5982\u8981\u4f7f\u7528<code>credential-cache<\/code>,\u5c31\u914d\u7f6e<code>cache<\/code>,\u5176\u4ed6\u5982<code>store<\/code>,<code>osxkeychain<\/code><\/p>\n\n\n\n<p><strong>cache<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>cache \u5c06\u51ed\u636e\u4e34\u65f6\u5b58\u5165\u5185\u5b58\u4e2d<\/p>\n\n\n\n<p><br><strong>\u7528\u6cd5\uff1a<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">git config credential.helper 'cache [&lt;options>]'<\/pre>\n\n\n\n<p>\u7f13\u5b58\u7684\u51ed\u636e\u5728\u7ecf\u8fc7\u4e00\u6bb5\u8d85\u65f6\u65f6\u95f4\u540e\u4f1a\u81ea\u52a8\u6e05\u7a7a\uff0c\u53ef\u4ee5\u901a\u8fc7Unix\u57df\u5957\u63a5\u5b57\u8bbf\u95ee\u7f13\u5b58\uff0c\u8bbf\u95ee\u7684\u6743\u9650\u53d7\u9650\u4e8e\u5f53\u524d\u7528\u6237\u5728\u6587\u4ef6\u7cfb\u7edf\u7684\u6743\u9650\u3002<\/p>\n\n\n\n<p><strong>\u9009\u9879:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">--timeout &lt;seconds> \u7f13\u5b58\u51ed\u636e\u7684\u79d2\u6570\uff0c\u9ed8\u8ba4\u4e3a900\u79d2\u3002\n--socket &lt;path> \u4f7f\u7528&lt;path>\u8054\u7cfb\u6b63\u5728\u8fd0\u884c\u7684\u7f13\u5b58\u5b88\u62a4\u7a0b\u5e8f(\u6216\u8005\u5982\u679c\u672a\u542f\u52a8\u65b0\u7684\u7f13\u5b58\u5b88\u62a4\u7a0b\u5e8f\uff0c\u5219\u542f\u52a8\u4e00\u4e2a)\u3002\u9ed8\u8ba4\u4e3a$XDG_CACHE_HOME\/git\/credential\/socket,\u9664\u975e~\/.git-credential-cache\/\u76ee\u5f55\u5b58\u5728\uff0c\u8fd9\u6837\u4f1a\u4f7f\u7528~\/.git-credential-cache\/socket\u3002\u53e6\u5916\u5fc5\u987b\u4f7f\u7528\u672c\u5730\u6587\u4ef6\u7cfb\u7edf\u4e2d\u7684\u7edd\u5bf9\u8def\u5f84\u3002<\/pre>\n\n\n\n<p>\u63a7\u5236\u5b88\u62a4\u8fdb\u7a0b:<br>\u5982\u679c\u5e0c\u671b\u63d0\u524d\u9000\u51fa\u5b88\u62a4\u8fdb\u7a0b\uff0c\u5728\u51ed\u636e\u8d85\u65f6\u524d\u63d0\u524d\u6e05\u7a7a\uff0c\u53ef\u4ee5\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ git credential-cache exit<\/pre>\n\n\n\n<p><strong>\u793a\u4f8b:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># \u9ed8\u8ba4\u8bbe\u7f6e\n$ git config credential.helper cache\n# \u6307\u5b9a\u8d85\u65f6\u65f6\u95f4\u4e3a30min\n$ git config credential.helper 'cache --timeout=1800'<\/pre>\n\n\n\n<p><strong>store<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>store \u5c06\u51ed\u636e\u5b58\u5165\u78c1\u76d8<\/p>\n\n\n\n<p><strong>\u7528\u6cd5\uff1a<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">git config credential.helper 'store [&lt;options>]'<\/pre>\n\n\n\n<p>\u4f7f\u7528\u6b64\u52a9\u624b\u4f1a\u5c06\u5bc6\u7801\u660e\u6587\u5b58\u50a8\u5728\u78c1\u76d8\u4e0a\uff0c\u5b89\u5168\u4f9d\u8d56\u4e8e\u6587\u4ef6\u7cfb\u7edf\u6743\u9650\uff0c\u5982\u679c\u8fd9\u70b9\u4e0d\u53ef\u63a5\u53d7\uff0c\u8bf7\u9009\u62e9<code>cache<\/code>\u6216<code>osxkeychain<\/code>\u6216\u5176\u4ed6\u5b89\u5168\u7684\u5b58\u50a8\u65b9\u5f0f\u3002<\/p>\n\n\n\n<p><strong>\u9009\u9879<\/strong>\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>--file=&lt;path><\/strong> \u4f7f\u7528<code>&lt;path><\/code>\u67e5\u627e\u548c\u5b58\u50a8\u51ed\u636e\u3002\u8be5\u6587\u4ef6\u4f9d\u8d56\u64cd\u4f5c\u7cfb\u7edf\u7684\u6743\u9650\u8bbf\u95ee\uff0c\u4f46\u4e0d\u4f1a\u52a0\u5bc6\u3002\u5982\u679c\u6ca1\u6709\u6307\u5b9a\uff0c\u9ed8\u8ba4\u4f1a\u4f9d\u6b21\u67e5\u627e<code>~\/.git-credentials<\/code>\u3001<code>$XDG_CONFIG_HOME\/git\/credentials<\/code>,\u5199\u7684\u987a\u5e8f\u4e5f\u662f\u4e00\u6837\u3002\u4f46\u662f\u5f53\u6e05\u7a7a\u51ed\u636e\u65f6\uff0c\u5c06\u4f1a\u4ece\u6240\u6709\u6587\u4ef6\u4e2d\u6e05\u9664\u3002<\/pre>\n\n\n\n<p><br><strong>\u793a\u4f8b<\/strong>\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># \u9ed8\u8ba4\u8bbe\u7f6e\n$ git config credential.helper store<\/pre>\n\n\n\n<p><strong>.git-credentials\u6587\u4ef6\u5185\u5bb9\u683c\u5f0f<\/strong><br><code>.git-credentials<\/code>\u6587\u4ef6\u4ee5\u7eaf\u6587\u672c\u683c\u5f0f\u5b58\u50a8\u3002\u6bcf\u4e2a\u51ed\u636e\u90fd\u4f5c\u4e3aURL\u5b58\u50a8\u5728\u5355\u72ec\u7684\u4e00\u884c\u4e2d\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">https:\/\/user:pass@example.com<\/pre>\n\n\n\n<p><strong>osxkeychain<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>\u5982\u679c\u4f60\u7684\u7cfb\u7edf\u4e2d\u6ca1\u6709\u5b89\u88c5osxkeychain\u8f85\u52a9\u5de5\u5177\uff0c\u5219\u9700\u8981\u5148\u884c\u5b89\u88c5\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">curl http:\/\/github-media-downloads.s3.amazonaws.com\/osx\/git-credential-osxkeychain -o git-credential-osxkeychain\nsudo mv git-credential-osxkeychain \/usr\/local\/bin\nsudo chmod u+x \/usr\/local\/bin\/git-credential-osxkeychain\n<\/pre>\n\n\n\n<p>\u5982\u679c\u4e60\u60ef\u4f7f\u7528\u547d\u4ee4\u884c\u8fdb\u884cgit\u64cd\u4f5c\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u542f\u7528\u51ed\u8bc1\u5b58\u50a8\u3002\u4ee5\u4e0b\u5747\u4ee5 osxkeychain\uff08\u94a5\u5319\u4e32\uff09 \u5b58\u50a8\u65b9\u5f0f\u4e3a\u4f8b\u8fdb\u884c\uff1a<\/p>\n\n\n\n<ul><li>\u542f\u7528 osxkeychain \uff08\u94a5\u5319\u4e32\uff09\u5b58\u50a8\uff1a<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">$ git config --global credential.helper osxkeychain<\/pre>\n\n\n\n<p>\u6267\u884c\u547d\u4ee4\u540e\u5728git\u7684\u5168\u5c40\u914d\u7f6e\u6587\u4ef6 ~\/.gitconfig \u4e2d\u4f1a\u6dfb\u52a0\u5982\u4e0b\u5185\u5bb9\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">[credential]\n\thelper = osxkeychain<\/pre>\n\n\n\n<ul><li>\u914d\u7f6e\u540e\uff0c\u6b63\u5e38\u60c5\u51b5\u4e0b\uff0c\u6211\u4eec\u5728\u901a\u8fc7git\u547d\u4ee4\u8fdb\u884c\u8fdc\u7a0b\u64cd\u4f5c\uff08\u5982git pull\uff09\u65f6\uff0c\u4f1a\u63d0\u793a\u8f93\u5165\u7528\u6237\u540d\u3001\u5bc6\u7801\uff1b\u9a8c\u8bc1\u6210\u529f\u540e\u8be5\u51ed\u8bc1\u4f1a\u4fdd\u5b58\u5230\u7cfb\u7edf\u7684\u94a5\u5319\u4e32\u4e2d\u3002\u5982\u4e0b\u56fe\uff1a<\/li><\/ul>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2023\/06\/\u56fe\u7247-19-1024x482.png\" alt=\"\" class=\"wp-image-11343\" width=\"488\" height=\"230\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2023\/06\/\u56fe\u7247-19-1024x482.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2023\/06\/\u56fe\u7247-19-300x141.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2023\/06\/\u56fe\u7247-19-768x362.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2023\/06\/\u56fe\u7247-19-830x391.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2023\/06\/\u56fe\u7247-19-230x108.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2023\/06\/\u56fe\u7247-19-350x165.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2023\/06\/\u56fe\u7247-19-480x226.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2023\/06\/\u56fe\u7247-19.png 1248w\" sizes=\"(max-width: 488px) 100vw, 488px\" \/><\/figure><\/div>\n\n\n\n<ul><li>\u51ed\u8bc1\u4fdd\u5b58\u540e\uff0c\u4e0b\u6b21\u8fdb\u884c\u8fdc\u7a0b\u64cd\u4f5c\u65f6\u5c31\u4e0d\u4f1a\u63d0\u793a\u8f93\u5165\u7528\u6237\u540d\u3001\u5bc6\u7801\u3002<\/li><\/ul>\n\n\n\n<p><strong>\u51ed\u8bc1\u5220\u9664<\/strong><\/p>\n\n\n\n<p>\u53ef\u4ee5\u76f4\u63a5\u4ece\u94a5\u5319\u4e32\u8bbf\u95eeapp\u9009\u4e2d\u8981\u5220\u9664\u7684\u51ed\u8bc1\uff0c\u53f3\u952e\u5220\u9664\u3002\u4e5f\u53ef\u4ee5\u901a\u8fc7\u547d\u4ee4\u5220\u9664\uff0c\u7a7a\u884c\u4ee3\u8868\u547d\u4ee4\u7ed3\u675f\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ git credential reject\nprotocol=http\nhost=git.jd.com<\/pre>\n\n\n\n<p>\u5220\u9664\u51ed\u8bc1\u540e\uff0c\u4e0b\u6b21\u767b\u5f55\u65f6\u4f1a\u91cd\u65b0\u63d0\u793a\u8f93\u5165\u7528\u6237\u540d\u3001\u5bc6\u7801\u3002<\/p>\n\n\n\n<p><strong>\u591a\u6a21\u5f0f\u5171\u5b58\u60c5\u51b5\u7684\u5904\u7406<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>\u4ee5\u4e0a\u4e24\u4e2a\u793a\u4f8b\u5747\u91c7\u7528\u5355\u4e00\u51ed\u8bc1\u5904\u7406\u6a21\u5f0f\uff0c\u5176\u5b9e\u662f\u53ef\u4ee5\u540c\u65f6\u91c7\u7528\u591a\u79cd\u51ed\u8bc1\u5b58\u50a8\u6a21\u5f0f\u7684\u3002<\/p>\n\n\n\n<p>\u5982\u679c\u540c\u65f6\u5b58\u5728\u4e24\u79cd\u51ed\u8bc1\u5b58\u50a8\u65b9\u5f0f<\/p>\n\n\n\n<ul><li>\u67e5\u8be2\u65f6\u4f1a\u6309\u987a\u5e8f\u6267\u884c\u5404\u51ed\u8bc1\u8f85\u52a9\u5de5\u5177\u8fdb\u884c\u67e5\u8be2\uff0c\u9047\u5230\u7b2c\u4e00\u4e2a\u5e94\u7b54\u5219\u9000\u51fa\u67e5\u8be2\uff1b<\/li><li>\u4fdd\u5b58\u65f6\u4f1a\u8c03\u7528\u6240\u6709\u7684\u51ed\u8bc1\u8f85\u52a9\u5de5\u5177\uff0c\u5404\u8f85\u52a9\u5de5\u5177\u6839\u636e\u81ea\u5df1\u7684\u903b\u8f91\u5904\u7406\u7528\u6237\u540d\u3001\u5bc6\u7801\u3002<\/li><\/ul>\n\n\n\n<p>\u5982\u679c\u4f60\u5728\u95ea\u5b58\u4e0a\u6709\u4e00\u4e2a\u51ed\u8bc1\u6587\u4ef6\uff0c\u4f46\u53c8\u5e0c\u671b\u5728\u8be5\u95ea\u5b58\u88ab\u62d4\u51fa\u7684\u60c5\u51b5\u4e0b\u4f7f\u7528\u5185\u5b58\u7f13\u5b58\u6765\u4fdd\u5b58\u7528\u6237\u540d\u5bc6\u7801\uff0c.gitconfig \u914d\u7f6e\u6587\u4ef6\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">[credential]\n    helper = store --file \/mnt\/thumbdrive\/.git-credentials\n    helper = cache --timeout 30000<\/pre>\n\n\n\n<p><strong>\u68c0\u67e5\u5f53\u524d\u4f7f\u7528\u7684\u52a9\u624b<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$ git config  -l |grep credential.helper\ncredential.helper=osxkeychain<\/pre>\n\n\n\n<p>\u770b\u5230\u8fd9\u91cc\uff0c\u6211\u51b3\u5b9a\u5c31\u4f7f\u7528\u5f53\u524d\u8bbe\u7f6e\u4e86\uff0c\u4f46\u95ee\u9898\u6765\u4e86\uff0c\u8f93\u5165\u5bc6\u7801\u4fdd\u5b58\u65e0\u6548\u554a\uff0c\u4e0d\u7ba1\u662f\u76f4\u63a5\u4eceshell\u4e2d\uff0c\u8fd8\u662fIdea\u4e2d\uff0c\u6bcf\u6b21\u66f4\u65b0\u4f9d\u7136\u63d0\u793a\u8f93\u5165\u7528\u6237\u540d\u5bc6\u7801\uff0c\u6839\u672c\u4e0d\u4f1a\u4fdd\u5b58\u4e0b\u6765\u3002\u5982\u679c\u4f60\u4e5f\u9047\u5230\u8fd9\u4e2a\u95ee\u9898\uff0c\u8bf7\u7ee7\u7eed\u5f80\u4e0b\u770b\u3002<\/p>\n\n\n\n<p>\u65e2\u7136\u6bcf\u6b21\u90fd\u63d0\u793a\uff0c\u6000\u7591\u662f\u94a5\u5319\u4e32\u4e2d\u6ca1\u6709\u4fdd\u5b58\u5bc6\u7801\uff0c\u4e8e\u662f\u6253\u5f00\u94a5\u5319\u4e32\uff0c\u641c\u7d22\u76f8\u5173\u5730\u5740\u548c\u7528\u6237\u540d\uff0c\u679c\u7136\u6ca1\u6709:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2023\/06\/\u56fe\u7247-20-1024x731.png\" alt=\"\" class=\"wp-image-11345\" width=\"466\" height=\"332\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2023\/06\/\u56fe\u7247-20-1024x731.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2023\/06\/\u56fe\u7247-20-300x214.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2023\/06\/\u56fe\u7247-20-768x549.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2023\/06\/\u56fe\u7247-20-830x593.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2023\/06\/\u56fe\u7247-20-230x164.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2023\/06\/\u56fe\u7247-20-350x250.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2023\/06\/\u56fe\u7247-20-480x343.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2023\/06\/\u56fe\u7247-20.png 1484w\" sizes=\"(max-width: 466px) 100vw, 466px\" \/><\/figure><\/div>\n\n\n\n<p>\u65e2\u7136\u4e0d\u80fd\u81ea\u52a8\u4fdd\u5b58\uff0c\u90a3\u5c31\u624b\u52a8\u6dfb\u52a0\u4e00\u4e2a\u5427\uff0c\u70b9\u51fb\u5de6\u4e0a\u89d2<code>+<\/code>\uff08\u6216\u8005\u70b9\u51fb<code>\u6587\u4ef6<\/code>-><code>\u65b0\u5efa\u5bc6\u7801\u9879...<\/code>\uff09,\u6839\u636e\u63d0\u793a\u586b\u5199\u5982\u4e0b\u4fe1\u606f:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2023\/06\/\u56fe\u7247-21.png\" alt=\"\" class=\"wp-image-11346\" width=\"427\" height=\"384\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2023\/06\/\u56fe\u7247-21.png 868w, https:\/\/92it.top\/wp-content\/uploads\/2023\/06\/\u56fe\u7247-21-300x270.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2023\/06\/\u56fe\u7247-21-768x692.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2023\/06\/\u56fe\u7247-21-830x748.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2023\/06\/\u56fe\u7247-21-230x207.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2023\/06\/\u56fe\u7247-21-350x315.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2023\/06\/\u56fe\u7247-21-480x432.png 480w\" sizes=\"(max-width: 427px) 100vw, 427px\" \/><\/figure><\/div>\n\n\n\n<p>\u4f46\u5f53\u70b9\u51fb\u6dfb\u52a0\u65f6\uff0c\u5374\u4e00\u76f4\u62a5\u9519\uff0c\u63d0\u793a\u6743\u9650\u9519\u8bef\uff0c\u591a\u6b21\u67e5\u627e\u65e0\u679c\uff0c\u5076\u7136\u53d1\u73b0\u5de6\u4fa7\u7684\u5c0f\u9501\u56fe\u6807\u662f\u5f00\u7740\u7684\uff0c\u4e8e\u662f\u53f3\u952e<code>\u9501\u5b9a\u94a5\u5319\u4e32\"\u767b\u5f55\"<\/code>\u540e\u91cd\u65b0\u6dfb\u52a0\u4e86\u4e00\u4e0b\uff0c\u7ec8\u4e8e\uff0c\u8fd9\u6b21\u5f39\u51fa\u6388\u6743\u786e\u8ba4\u6846\uff0c\u8f93\u5165\u5f53\u524d\u7528\u6237\u5bc6\u7801\u786e\u8ba4\u540e\u6dfb\u52a0\u6210\u529f\uff01<\/p>\n\n\n\n<p>\u7136\u540e\u6267\u884c\u4e00\u4e0b<code>git fetch<\/code>\u547d\u4ee4\u4e5f\u5f39\u51fa\u4e86<code>git-credential-osxkeychain<\/code>\u8bbf\u95ee\u6388\u6743\u7684\u7a97\u53e3\uff0c\u800c\u4e0d\u662f\u7b80\u5355\u7684\u8be2\u95eegit\u7684\u7528\u6237\u540d\u5bc6\u7801\uff0c\u8bf4\u660e\u751f\u6548\u4e86:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2023\/06\/\u56fe\u7247-22.png\" alt=\"\" class=\"wp-image-11347\" width=\"448\" height=\"201\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2023\/06\/\u56fe\u7247-22.png 878w, https:\/\/92it.top\/wp-content\/uploads\/2023\/06\/\u56fe\u7247-22-300x135.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2023\/06\/\u56fe\u7247-22-768x346.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2023\/06\/\u56fe\u7247-22-830x374.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2023\/06\/\u56fe\u7247-22-230x104.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2023\/06\/\u56fe\u7247-22-350x158.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2023\/06\/\u56fe\u7247-22-480x216.png 480w\" sizes=\"(max-width: 448px) 100vw, 448px\" \/><\/figure><\/div>\n\n\n\n<p>\u786e\u8ba4\u7cfb\u7edf\u7ba1\u7406\u5458\u5bc6\u7801\uff08\u5f53\u524d\u767b\u5f55\u7528\u6237\uff09\u540e\uff0c\u70b9\u51fb<code>\u59cb\u7ec8\u5141\u8bb8<\/code>\u5373\u53ef\u3002<\/p>\n\n\n\n<p><p>\u6ce8\uff1a\u9501\u4f4f\u7684&#8221;\u767b\u5f55&#8221;\u94a5\u5319\u4e32\u53c8\u53d8\u4e3a\u4e86\u6253\u5f00\u7684\u72b6\u6001\u3002\u672c\u6b21\u6545\u969c\u731c\u6d4b\u662f\u7531\u4e8e\u7cfb\u7edf\u91cd\u542f\u6216\u66f4\u65b0\u540e\u5bfc\u81f4\u6743\u9650\u9519\u8bef\uff0c\u672a\u9a8c\u8bc1\u3002<\/p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u80cc\u666f git\u6709\u65f6\u9700\u8981\u7528\u6237\u63d0\u4f9b\u51ed\u636e\u624d\u80fd\u64cd\u4f5c\uff0c\u6bd4\u5982\u4e00\u822c\u516c\u53f8\u7684git\u670d\u52a1\u5668\u50cfgitlab\u7b49\u90fd\u4f1a\u9700\u8981\u63d0\u4f9b\u7528\u6237\u540d\u548c\u5bc6\u7801\u624d [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[],"_links":{"self":[{"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/11341"}],"collection":[{"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=11341"}],"version-history":[{"count":3,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/11341\/revisions"}],"predecessor-version":[{"id":11348,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/11341\/revisions\/11348"}],"wp:attachment":[{"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=11341"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=11341"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=11341"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}