{"id":12850,"date":"2024-01-06T16:11:29","date_gmt":"2024-01-06T08:11:29","guid":{"rendered":"http:\/\/www.aiersheng.cc\/?p=12850"},"modified":"2025-01-06T16:19:52","modified_gmt":"2025-01-06T08:19:52","slug":"windows%e5%ae%89%e8%a3%85git","status":"publish","type":"post","link":"https:\/\/www.aiersheng.cc\/?p=12850","title":{"rendered":"CentOS 7.4 \u548c Windows \u5b89\u88c5 Git \u4e0e Git \u5de5\u4f5c\u6d41\u7a0b\u8be6\u89e3"},"content":{"rendered":"<h3>CentOS 7.4 \u548c Windows \u5b89\u88c5 Git \u4e0e Git \u5de5\u4f5c\u6d41\u7a0b\u8be6\u89e3<\/h3>\n<h4>\u4e00\u3001Git \u7b80\u4ecb<\/h4>\n<p>Git \u662f\u4e00\u4e2a\u5f00\u6e90\u7684\u5206\u5e03\u5f0f\u7248\u672c\u63a7\u5236\u7cfb\u7edf\uff0c\u6700\u521d\u7531 <strong>Linus Torvalds<\/strong> \u4e3a\u4e86\u5e2e\u52a9\u7ba1\u7406 Linux \u5185\u6838\u5f00\u53d1\u800c\u5f00\u53d1\u3002Git \u53ef\u4ee5\u9ad8\u6548\u5730\u7ba1\u7406\u6e90\u4ee3\u7801\u7684\u7248\u672c\uff0c\u5e76\u652f\u6301\u654f\u6377\u5f00\u53d1\u7684\u9700\u6c42\u3002\u4e0e\u4f20\u7edf\u7684\u7248\u672c\u63a7\u5236\u5de5\u5177\u5982 <strong>SVN<\/strong> \u548c <strong>CVS<\/strong> \u76f8\u6bd4\uff0cGit \u91c7\u7528\u4e86\u5206\u5e03\u5f0f\u7248\u672c\u63a7\u5236\u65b9\u5f0f\uff0c\u6bcf\u4e2a\u5f00\u53d1\u8005\u7684\u8ba1\u7b97\u673a\u4e0a\u90fd\u6709\u4e00\u4e2a\u5b8c\u6574\u7684\u4ee3\u7801\u4ed3\u5e93\u526f\u672c\uff0c\u4ece\u800c\u4e0d\u518d\u4f9d\u8d56\u4e2d\u592e\u670d\u52a1\u5668\u3002<\/p>\n<h4>\u4e8c\u3001Git \u4e0e SVN \u7684\u533a\u522b<\/h4>\n<ol>\n<li>\n<p><strong>\u5206\u5e03\u5f0f vs \u96c6\u4e2d\u5f0f<\/strong>\uff1a<\/p>\n<ul>\n<li><strong>Git<\/strong> \u662f\u5206\u5e03\u5f0f\u7684\uff0c\u6bcf\u4e2a\u5f00\u53d1\u8005\u90fd\u62e5\u6709\u81ea\u5df1\u5b8c\u6574\u7684\u4ed3\u5e93\uff0c\u4e0d\u4f9d\u8d56\u4e2d\u592e\u670d\u52a1\u5668\u3002\u5373\u4f7f\u6ca1\u6709\u7f51\u7edc\u8fde\u63a5\uff0c\u4e5f\u53ef\u4ee5\u8fdb\u884c\u7248\u672c\u63a7\u5236\u548c\u63d0\u4ea4\u3002<\/li>\n<li><strong>SVN<\/strong> \u662f\u96c6\u4e2d\u5f0f\u7684\uff0c\u6240\u6709\u7248\u672c\u5386\u53f2\u90fd\u4fdd\u5b58\u5728\u4e00\u4e2a\u4e2d\u592e\u670d\u52a1\u5668\u4e0a\uff0c\u5f00\u53d1\u8005\u9700\u8981\u7f51\u7edc\u8fde\u63a5\u624d\u80fd\u8bbf\u95ee\u4ee3\u7801\u5e93\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u5185\u5bb9\u5b58\u50a8\u65b9\u5f0f<\/strong>\uff1a<\/p>\n<ul>\n<li><strong>Git<\/strong> \u5c06\u5185\u5bb9\u5b58\u50a8\u4e3a\u5bf9\u8c61\uff0c\u901a\u8fc7\u5143\u6570\u636e\u7684\u65b9\u5f0f\u6765\u4fdd\u5b58\u6bcf\u6b21\u63d0\u4ea4\u7684\u5185\u5bb9\u548c\u53d8\u66f4\u4fe1\u606f\uff0c\u4f7f\u7528 SHA-1 \u54c8\u5e0c\u7b97\u6cd5\u6807\u8bc6\uff0c\u786e\u4fdd\u4ee3\u7801\u5185\u5bb9\u7684\u5b8c\u6574\u6027\u3002<\/li>\n<li><strong>SVN<\/strong> \u662f\u6309\u6587\u4ef6\u5b58\u50a8\u7684\uff0c\u6bcf\u6b21\u63d0\u4ea4\u90fd\u4f1a\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u6587\u4ef6\u8bb0\u5f55\uff0c\u6309\u6587\u4ef6\u7684\u65b9\u5f0f\u7ba1\u7406\u7248\u672c\u5386\u53f2\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u5206\u652f\u7684\u5b9e\u73b0<\/strong>\uff1a<\/p>\n<ul>\n<li><strong>Git<\/strong> \u7684\u5206\u652f\u975e\u5e38\u8f7b\u91cf\uff0c\u5206\u652f\u672c\u8d28\u4e0a\u662f\u6307\u5411\u63d0\u4ea4\u7684\u6307\u9488\uff0c\u975e\u5e38\u5feb\u901f\u4e14\u9ad8\u6548\uff0c\u652f\u6301\u591a\u4e2a\u5e76\u884c\u5f00\u53d1\u5206\u652f\u3002<\/li>\n<li><strong>SVN<\/strong> \u7684\u5206\u652f\u76f8\u5bf9\u8f83\u91cd\uff0c\u5206\u652f\u4ec5\u662f\u7248\u672c\u5e93\u4e2d\u7684\u4e00\u4e2a\u76ee\u5f55\uff0c\u521b\u5efa\u548c\u7ba1\u7406\u5206\u652f\u9700\u8981\u8f83\u5927\u7684\u5b58\u50a8\u548c\u8ba1\u7b97\u5f00\u9500\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u7248\u672c\u53f7<\/strong>\uff1a<\/p>\n<ul>\n<li><strong>Git<\/strong> \u4e0d\u4f7f\u7528\u5168\u5c40\u7248\u672c\u53f7\uff0c\u6bcf\u4e2a\u4ed3\u5e93\u6709\u81ea\u5df1\u72ec\u7acb\u7684\u7248\u672c\u5386\u53f2\u3002<\/li>\n<li><strong>SVN<\/strong> \u4f7f\u7528\u5168\u5c40\u7248\u672c\u53f7\uff0c\u6bcf\u6b21\u63d0\u4ea4\u90fd\u4f1a\u589e\u52a0\u7248\u672c\u53f7\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u5185\u5bb9\u5b8c\u6574\u6027<\/strong>\uff1a<\/p>\n<ul>\n<li><strong>Git<\/strong> \u4f7f\u7528 SHA-1 \u54c8\u5e0c\u7b97\u6cd5\u4fdd\u8bc1\u5185\u5bb9\u5b8c\u6574\u6027\uff0c\u5373\u4f7f\u9047\u5230\u78c1\u76d8\u6545\u969c\u6216\u7f51\u7edc\u95ee\u9898\uff0c\u4e5f\u80fd\u6709\u6548\u907f\u514d\u6570\u636e\u635f\u574f\u3002<\/li>\n<li><strong>SVN<\/strong> \u5bf9\u5185\u5bb9\u5b8c\u6574\u6027\u4fdd\u62a4\u8f83\u5f31\uff0c\u65e0\u6cd5\u50cf Git \u90a3\u6837\u8fdb\u884c\u9ad8\u6548\u7684\u6821\u9a8c\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<hr \/>\n<h3>\u4e09\u3001\u5728 CentOS 7.4 \u4e0a\u5b89\u88c5 Git<\/h3>\n<p>Git \u7684\u5b89\u88c5\u8fc7\u7a0b\u975e\u5e38\u7b80\u5355\uff0c\u53ef\u4ee5\u901a\u8fc7\u7cfb\u7edf\u7684\u5305\u7ba1\u7406\u5de5\u5177 <code>yum<\/code> \u6765\u8fdb\u884c\u5b89\u88c5\u3002<\/p>\n<h5>1. \u66f4\u65b0\u7cfb\u7edf\u8f6f\u4ef6\u5305<\/h5>\n<p>\u5728\u5b89\u88c5\u4efb\u4f55\u8f6f\u4ef6\u4e4b\u524d\uff0c\u9996\u5148\u9700\u8981\u66f4\u65b0\u7cfb\u7edf\u7684\u8f6f\u4ef6\u5305\u5217\u8868\uff1a<\/p>\n<div class=\"contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950\">\n<div class=\"flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none\">bash<\/div>\n<div class=\"sticky top-9 md:top-[5.75rem]\">\n<div class=\"absolute bottom-0 right-2 flex h-9 items-center\">\n<div class=\"flex items-center rounded bg-token-sidebar-surface-primary px-2 font-sans text-xs text-token-text-secondary dark:bg-token-main-surface-secondary\"><span class=\"\" data-state=\"closed\"><button class=\"flex gap-1 items-center select-none py-1\" aria-label=\"\u590d\u5236\">\u590d\u5236\u4ee3\u7801<\/button><\/span><\/div>\n<\/div>\n<\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"!whitespace-pre hljs language-bash\">sudo yum update<br \/>\n<\/code><\/div>\n<\/div>\n<h5>2. \u5b89\u88c5 Git<\/h5>\n<p>CentOS 7.4 \u9ed8\u8ba4\u7684 <strong>YUM \u4ed3\u5e93<\/strong> \u4e2d\u5df2\u5305\u542b Git\uff0c\u53ef\u4ee5\u4f7f\u7528 <code>yum<\/code> \u547d\u4ee4\u8fdb\u884c\u5b89\u88c5\uff1a<\/p>\n<div class=\"contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950\">\n<div class=\"flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none\">bash<\/div>\n<div class=\"sticky top-9 md:top-[5.75rem]\">\n<div class=\"absolute bottom-0 right-2 flex h-9 items-center\">\n<div class=\"flex items-center rounded bg-token-sidebar-surface-primary px-2 font-sans text-xs text-token-text-secondary dark:bg-token-main-surface-secondary\"><span class=\"\" data-state=\"closed\"><button class=\"flex gap-1 items-center select-none py-1\" aria-label=\"\u590d\u5236\">\u590d\u5236\u4ee3\u7801<\/button><\/span><\/div>\n<\/div>\n<\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"!whitespace-pre hljs language-bash\">sudo yum install git<br \/>\n<\/code><\/div>\n<\/div>\n<h5>3. \u9a8c\u8bc1\u5b89\u88c5<\/h5>\n<p>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u9a8c\u8bc1 Git \u662f\u5426\u5b89\u88c5\u6210\u529f\uff1a<\/p>\n<div class=\"contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950\">\n<div class=\"flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none\">bash<\/div>\n<div class=\"sticky top-9 md:top-[5.75rem]\">\n<div class=\"absolute bottom-0 right-2 flex h-9 items-center\">\n<div class=\"flex items-center rounded bg-token-sidebar-surface-primary px-2 font-sans text-xs text-token-text-secondary dark:bg-token-main-surface-secondary\"><span class=\"\" data-state=\"closed\"><button class=\"flex gap-1 items-center select-none py-1\" aria-label=\"\u590d\u5236\">\u590d\u5236\u4ee3\u7801<\/button><\/span><\/div>\n<\/div>\n<\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"!whitespace-pre hljs language-bash\">git --version<br \/>\n<\/code><\/div>\n<\/div>\n<p>\u5982\u679c\u5b89\u88c5\u6210\u529f\uff0c\u4f60\u4f1a\u770b\u5230\u7c7b\u4f3c\u4ee5\u4e0b\u7684\u8f93\u51fa\uff0c\u663e\u793a Git \u7684\u7248\u672c\u53f7\uff1a<\/p>\n<div class=\"contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950\">\n<div class=\"flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none\">bash<\/div>\n<div class=\"sticky top-9 md:top-[5.75rem]\">\n<div class=\"absolute bottom-0 right-2 flex h-9 items-center\">\n<div class=\"flex items-center rounded bg-token-sidebar-surface-primary px-2 font-sans text-xs text-token-text-secondary dark:bg-token-main-surface-secondary\"><span class=\"\" data-state=\"closed\"><button class=\"flex gap-1 items-center select-none py-1\" aria-label=\"\u590d\u5236\">\u590d\u5236\u4ee3\u7801<\/button><\/span><\/div>\n<\/div>\n<\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"!whitespace-pre hljs language-bash\">git version 2.18.1<br \/>\n<\/code><\/div>\n<\/div>\n<h5>4. \u914d\u7f6e Git<\/h5>\n<p>\u5728\u9996\u6b21\u4f7f\u7528 Git \u65f6\uff0c\u5efa\u8bae\u8bbe\u7f6e\u5168\u5c40\u7684\u7528\u6237\u540d\u548c\u7535\u5b50\u90ae\u4ef6\u5730\u5740\uff0c\u8fd9\u4e9b\u4fe1\u606f\u4f1a\u51fa\u73b0\u5728\u4f60\u63d0\u4ea4\u7684\u5386\u53f2\u8bb0\u5f55\u4e2d\u3002\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u8fdb\u884c\u914d\u7f6e\uff1a<\/p>\n<div class=\"contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950\">\n<div class=\"flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none\">bash<\/div>\n<div class=\"sticky top-9 md:top-[5.75rem]\">\n<div class=\"absolute bottom-0 right-2 flex h-9 items-center\">\n<div class=\"flex items-center rounded bg-token-sidebar-surface-primary px-2 font-sans text-xs text-token-text-secondary dark:bg-token-main-surface-secondary\"><span class=\"\" data-state=\"closed\"><button class=\"flex gap-1 items-center select-none py-1\" aria-label=\"\u590d\u5236\">\u590d\u5236\u4ee3\u7801<\/button><\/span><\/div>\n<\/div>\n<\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"!whitespace-pre hljs language-bash\">git config --global user.name <span class=\"hljs-string\">\"Your Name\"<\/span><br \/>\ngit config --global user.email <span class=\"hljs-string\">\"youremail@example.com\"<\/span><br \/>\n<\/code><\/div>\n<\/div>\n<p>\u6b64\u5916\uff0c\u4f60\u8fd8\u53ef\u4ee5\u901a\u8fc7 <code>git config<\/code> \u547d\u4ee4\u8bbe\u7f6e\u5176\u4ed6\u914d\u7f6e\u9879\uff0c\u5982\u9ed8\u8ba4\u7f16\u8f91\u5668\u3001\u884c\u7ed3\u675f\u7b26\u7b49\u3002<\/p>\n<hr \/>\n<h3>\u56db\u3001\u5728 Windows \u4e0a\u5b89\u88c5 Git<\/h3>\n<h4>1. \u4e0b\u8f7d Git \u5b89\u88c5\u5305<\/h4>\n<p>\u4ece Git \u5b98\u65b9\u4e0b\u8f7d\u9875\u9762\u4e0b\u8f7d\u9002\u7528\u4e8e Windows \u7684 Git \u5b89\u88c5\u7a0b\u5e8f\uff1a <a href=\"https:\/\/gitforwindows.org\/\" target=\"_new\" rel=\"noopener\">Git for Windows \u4e0b\u8f7d\u94fe\u63a5<\/a><\/p>\n<h4>2. \u5b89\u88c5 Git<\/h4>\n<ul>\n<li>\u53cc\u51fb\u4e0b\u8f7d\u7684\u5b89\u88c5\u7a0b\u5e8f\uff0c\u5f00\u59cb\u5b89\u88c5 Git\u3002<\/li>\n<li>\u5728\u5b89\u88c5\u8fc7\u7a0b\u4e2d\uff0c\u53ef\u4ee5\u6839\u636e\u9700\u8981\u9009\u62e9\u4ee5\u4e0b\u9009\u9879\uff1a\n<ul>\n<li><strong>\u9009\u62e9\u5b89\u88c5\u8def\u5f84<\/strong>\uff1a\u53ef\u4ee5\u9009\u62e9\u5b89\u88c5\u8def\u5f84\uff0c\u9ed8\u8ba4\u4e3a <code>C:\\Program Files\\Git<\/code>\u3002<\/li>\n<li><strong>\u9009\u62e9\u7ec4\u4ef6<\/strong>\uff1a\u4f60\u53ef\u4ee5\u9009\u62e9\u5b89\u88c5 Git Bash\uff08\u7ec8\u7aef\u5de5\u5177\uff09\u4ee5\u53ca Git GUI\uff08\u56fe\u5f62\u754c\u9762\u5de5\u5177\uff09\u3002<\/li>\n<li><strong>\u914d\u7f6e\u73af\u5883\u53d8\u91cf<\/strong>\uff1a\u9009\u62e9\u5c06 Git \u6dfb\u52a0\u5230\u7cfb\u7edf\u73af\u5883\u53d8\u91cf\u4e2d\uff0c\u8fd9\u6837\u53ef\u4ee5\u5728\u547d\u4ee4\u884c\u4e2d\u4f7f\u7528 Git\u3002<\/li>\n<li><strong>\u9009\u62e9\u9ed8\u8ba4\u7f16\u8f91\u5668<\/strong>\uff1a\u9009\u62e9\u4f60\u559c\u6b22\u7684\u6587\u672c\u7f16\u8f91\u5668\uff08\u5982 Vim\u3001Notepad++ \u7b49\uff09\u3002<\/li>\n<li><strong>\u9009\u62e9\u7ec8\u7aef\u6a21\u62df\u5668<\/strong>\uff1a\u4f60\u53ef\u4ee5\u9009\u62e9\u4f7f\u7528 Git Bash \u4f5c\u4e3a\u7ec8\u7aef\u5de5\u5177\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u70b9\u51fb <strong>Finish<\/strong>\u3002<\/li>\n<\/ul>\n<h4>3. \u9a8c\u8bc1\u5b89\u88c5<\/h4>\n<p>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u53ef\u4ee5\u6253\u5f00 <strong>Git Bash<\/strong> \u6216\u8005 <strong>\u547d\u4ee4\u63d0\u793a\u7b26<\/strong>\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u9a8c\u8bc1\u662f\u5426\u5b89\u88c5\u6210\u529f\uff1a<\/p>\n<div class=\"contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950\">\n<div class=\"flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none\">bash<\/div>\n<div class=\"sticky top-9 md:top-[5.75rem]\">\n<div class=\"absolute bottom-0 right-2 flex h-9 items-center\">\n<div class=\"flex items-center rounded bg-token-sidebar-surface-primary px-2 font-sans text-xs text-token-text-secondary dark:bg-token-main-surface-secondary\"><span class=\"\" data-state=\"closed\"><button class=\"flex gap-1 items-center select-none py-1\" aria-label=\"\u590d\u5236\">\u590d\u5236\u4ee3\u7801<\/button><\/span><\/div>\n<\/div>\n<\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"!whitespace-pre hljs language-bash\">git --version<br \/>\n<\/code><\/div>\n<\/div>\n<p>\u5982\u679c\u5b89\u88c5\u6210\u529f\uff0c\u4f1a\u663e\u793a Git \u7684\u7248\u672c\u4fe1\u606f\uff0c\u4f8b\u5982\uff1a<\/p>\n<div class=\"contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950\">\n<div class=\"flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none\">bash<\/div>\n<div class=\"sticky top-9 md:top-[5.75rem]\">\n<div class=\"absolute bottom-0 right-2 flex h-9 items-center\">\n<div class=\"flex items-center rounded bg-token-sidebar-surface-primary px-2 font-sans text-xs text-token-text-secondary dark:bg-token-main-surface-secondary\"><span class=\"\" data-state=\"closed\"><button class=\"flex gap-1 items-center select-none py-1\" aria-label=\"\u590d\u5236\">\u590d\u5236\u4ee3\u7801<\/button><\/span><\/div>\n<\/div>\n<\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"!whitespace-pre hljs language-bash\">git version 2.45.0.windows.1<br \/>\n<\/code><\/div>\n<\/div>\n<h4>4. \u914d\u7f6e Git<\/h4>\n<p>\u5728 Windows \u4e0a\u4f7f\u7528 Git \u524d\uff0c\u4f60\u9700\u8981\u8bbe\u7f6e Git \u7684\u7528\u6237\u4fe1\u606f\uff1a<\/p>\n<div class=\"contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950\">\n<div class=\"flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none\">bash<\/div>\n<div class=\"sticky top-9 md:top-[5.75rem]\">\n<div class=\"absolute bottom-0 right-2 flex h-9 items-center\">\n<div class=\"flex items-center rounded bg-token-sidebar-surface-primary px-2 font-sans text-xs text-token-text-secondary dark:bg-token-main-surface-secondary\"><span class=\"\" data-state=\"closed\"><button class=\"flex gap-1 items-center select-none py-1\" aria-label=\"\u590d\u5236\">\u590d\u5236\u4ee3\u7801<\/button><\/span><\/div>\n<\/div>\n<\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"!whitespace-pre hljs language-bash\">git config --global user.name <span class=\"hljs-string\">\"Your Name\"<\/span><br \/>\ngit config --global user.email <span class=\"hljs-string\">\"youremail@example.com\"<\/span><br \/>\n<\/code><\/div>\n<\/div>\n<hr \/>\n<h3>\u4e94\u3001Git \u5de5\u4f5c\u6d41\u7a0b\uff1a\u5de5\u4f5c\u533a\u3001\u7f13\u5b58\u533a\u4e0e\u7248\u672c\u5e93<\/h3>\n<p>Git \u7684\u5de5\u4f5c\u6d41\u7a0b\u5927\u81f4\u5206\u4e3a\u4ee5\u4e0b\u51e0\u4e2a\u533a\u57df\uff1a\u5de5\u4f5c\u533a\u3001\u7f13\u5b58\u533a\uff08\u6682\u5b58\u533a\uff09\u3001\u7248\u672c\u5e93\u3002\u6bcf\u4e2a\u533a\u57df\u6709\u5176\u7279\u5b9a\u7684\u4f5c\u7528\u548c\u547d\u4ee4\u3002<\/p>\n<ol>\n<li>\n<p><strong>\u5de5\u4f5c\u533a\uff08Working Directory\uff09<\/strong>\uff1a<\/p>\n<ul>\n<li>\n<p>\u5de5\u4f5c\u533a\u662f\u4f60\u672c\u5730\u8ba1\u7b97\u673a\u4e0a\u7684\u9879\u76ee\u76ee\u5f55\uff0c\u5305\u542b\u6240\u6709\u6e90\u4ee3\u7801\u6587\u4ef6\u548c\u5176\u4ed6\u9879\u76ee\u6587\u4ef6\u3002\u6587\u4ef6\u5728\u5de5\u4f5c\u533a\u7684\u4fee\u6539\u4e0d\u4f1a\u76f4\u63a5\u5f71\u54cd\u7248\u672c\u5e93\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u64cd\u4f5c<\/strong>\uff1a\u5f53\u4f60\u7f16\u8f91\u6587\u4ef6\u65f6\uff0cGit \u4f1a\u5c06\u8fd9\u4e9b\u6587\u4ef6\u6807\u8bb0\u4e3a\u5df2\u4fee\u6539\uff08modified\uff09\u3002<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u7f13\u5b58\u533a\uff08Staging Area\uff09<\/strong>\uff1a<\/p>\n<ul>\n<li>\n<p>\u7f13\u5b58\u533a\u4e5f\u53eb\u6682\u5b58\u533a\uff0c\u5b83\u662f\u4e00\u4e2a\u4e2d\u95f4\u533a\u57df\uff0c\u5b58\u50a8\u5df2\u6dfb\u52a0\u4f46\u672a\u63d0\u4ea4\u7684\u6587\u4ef6\u5feb\u7167\u3002\u4f7f\u7528 <code>git add<\/code> \u547d\u4ee4\u5c06\u4fee\u6539\u8fc7\u7684\u6587\u4ef6\u6dfb\u52a0\u5230\u7f13\u5b58\u533a\uff0c\u51c6\u5907\u63d0\u4ea4\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u64cd\u4f5c<\/strong>\uff1a<\/p>\n<ul>\n<li>\u4f7f\u7528 <code>git add &lt;file&gt;<\/code> \u547d\u4ee4\u5c06\u6587\u4ef6\u4ece\u5de5\u4f5c\u533a\u6dfb\u52a0\u5230\u7f13\u5b58\u533a\u3002<\/li>\n<li>\u4f7f\u7528 <code>git status<\/code> \u547d\u4ee4\u67e5\u770b\u54ea\u4e9b\u6587\u4ef6\u5df2\u6682\u5b58\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u7248\u672c\u5e93\uff08Repository\uff09<\/strong>\uff1a<\/p>\n<ul>\n<li>\n<p>\u7248\u672c\u5e93\u4fdd\u5b58\u7740\u6240\u6709\u7684\u5386\u53f2\u8bb0\u5f55\uff0c\u5305\u62ec\u63d0\u4ea4\u5386\u53f2\u3001\u5206\u652f\u4fe1\u606f\u3001\u6807\u7b7e\u7b49\u3002Git \u6709\u672c\u5730\u7248\u672c\u5e93\u548c\u8fdc\u7a0b\u7248\u672c\u5e93\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u64cd\u4f5c<\/strong>\uff1a<\/p>\n<ul>\n<li>\u4f7f\u7528 <code>git commit<\/code> \u547d\u4ee4\u5c06\u7f13\u5b58\u533a\u7684\u66f4\u6539\u63d0\u4ea4\u5230\u672c\u5730\u7248\u672c\u5e93\u3002<\/li>\n<li>\u4f7f\u7528 <code>git push<\/code> \u5c06\u672c\u5730\u7248\u672c\u5e93\u7684\u66f4\u6539\u63a8\u9001\u5230\u8fdc\u7a0b\u7248\u672c\u5e93\uff0c\u8fdb\u884c\u56e2\u961f\u534f\u4f5c\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<hr \/>\n<h3>\u516d\u3001\u603b\u7ed3<\/h3>\n<p>Git \u662f\u4e00\u4e2a\u529f\u80fd\u5f3a\u5927\u4e14\u9ad8\u6548\u7684\u5206\u5e03\u5f0f\u7248\u672c\u63a7\u5236\u7cfb\u7edf\uff0c\u7279\u522b\u9002\u7528\u4e8e\u9700\u8981\u9ad8\u6548\u7ba1\u7406\u548c\u534f\u4f5c\u5f00\u53d1\u7684\u9879\u76ee\u3002\u4e0e\u4f20\u7edf\u7684\u96c6\u4e2d\u5f0f\u7248\u672c\u63a7\u5236\u7cfb\u7edf\uff08\u5982 SVN\uff09\u76f8\u6bd4\uff0cGit \u63d0\u4f9b\u4e86\u66f4\u591a\u7684\u7075\u6d3b\u6027\u548c\u5f3a\u5927\u7684\u529f\u80fd\uff0c\u4f8b\u5982\u5206\u652f\u7ba1\u7406\u3001\u7248\u672c\u63a7\u5236\u3001\u5185\u5bb9\u5b8c\u6574\u6027\u7b49\u3002\u901a\u8fc7\u5b66\u4e60 Git \u7684\u57fa\u672c\u5de5\u4f5c\u6d41\u7a0b\u3001\u4e86\u89e3\u5de5\u4f5c\u533a\u3001\u7f13\u5b58\u533a\u548c\u7248\u672c\u5e93\u7684\u4f5c\u7528\uff0c\u4ee5\u53ca\u638c\u63e1\u5e38\u7528\u7684 Git \u547d\u4ee4\uff0c\u4f60\u53ef\u4ee5\u66f4\u9ad8\u6548\u5730\u7ba1\u7406\u4ee3\u7801\u7248\u672c\u3001\u534f\u8c03\u56e2\u961f\u5f00\u53d1\u3002<\/p>\n<ul>\n<li>\u5728 <strong>CentOS 7.4<\/strong> \u4e0a\u5b89\u88c5 Git \u8fc7\u7a0b\u7b80\u5355\uff0c\u901a\u8fc7\u547d\u4ee4\u884c\u5373\u53ef\u5feb\u901f\u5b89\u88c5\u548c\u914d\u7f6e\u3002<\/li>\n<li>\u5728 <strong>Windows<\/strong> \u4e0a\u5b89\u88c5 Git \u540c\u6837\u4fbf\u6377\uff0c\u53ea\u9700\u4e0b\u8f7d\u5e76\u8fd0\u884c\u5b89\u88c5\u7a0b\u5e8f\uff0c\u51e0\u6b65\u7b80\u5355\u8bbe\u7f6e\u5373\u53ef\u5b8c\u6210\u5b89\u88c5\u3002<\/li>\n<\/ul>\n<p>Git \u7684\u5f3a\u5927\u529f\u80fd\u548c\u9ad8\u6548\u5de5\u4f5c\u6d41\u7a0b\uff0c\u4f7f\u5176\u6210\u4e3a\u73b0\u4ee3\u5f00\u53d1\u56e2\u961f\u5fc5\u5907\u7684\u5de5\u5177\uff0c\u65e0\u8bba\u662f\u4e2a\u4eba\u5f00\u53d1\u8fd8\u662f\u56e2\u961f\u534f\u4f5c\uff0cGit \u90fd\u80fd\u63d0\u4f9b\u9ad8\u6548\u7684\u7248\u672c\u63a7\u5236\u548c\u7ba1\u7406\u89e3\u51b3\u65b9\u6848\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>CentOS 7.4 \u548c Windows&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[68],"tags":[],"class_list":["post-12850","post","type-post","status-publish","format-standard","hentry","category-zzjy"],"_links":{"self":[{"href":"https:\/\/www.aiersheng.cc\/index.php?rest_route=\/wp\/v2\/posts\/12850","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.aiersheng.cc\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.aiersheng.cc\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.aiersheng.cc\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.aiersheng.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=12850"}],"version-history":[{"count":0,"href":"https:\/\/www.aiersheng.cc\/index.php?rest_route=\/wp\/v2\/posts\/12850\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.aiersheng.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=12850"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.aiersheng.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=12850"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.aiersheng.cc\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=12850"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}