{"id":40383,"date":"2025-05-28T17:16:35","date_gmt":"2025-05-28T09:16:35","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/40383.html"},"modified":"2025-05-28T17:16:35","modified_gmt":"2025-05-28T09:16:35","slug":"%e3%80%90linux-%e5%ad%a6%e4%b9%a0%e8%ae%a1%e5%88%92%e3%80%91-git-%e5%9c%a8linux%e8%bf%9c%e7%ab%af%e6%9c%8d%e5%8a%a1%e5%99%a8%e4%b8%8a%e7%9a%84%e9%83%a8%e7%bd%b2%e4%b8%8e%e7%ae%80%e5%8d%95%e4%bd%bf","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/40383.html","title":{"rendered":"\u3010Linux \u5b66\u4e60\u8ba1\u5212\u3011-- git \u5728Linux\u8fdc\u7aef\u670d\u52a1\u5668\u4e0a\u7684\u90e8\u7f72\u4e0e\u7b80\u5355\u4f7f\u7528"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"1200\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250528091629-6836d46dc2862.png\" width=\"1920\" \/><\/p>\n<p id=\"main-toc\">\u76ee\u5f55<\/p>\n<p id=\"%E5%AE%89%E8%A3%85%20git-toc\" style=\"margin-left:0px\">\u5b89\u88c5 git<\/p>\n<p id=\"%E5%88%9B%E5%BB%BA%E4%BB%93%E5%BA%93%20%26%26%20%E5%A6%82%E4%BD%95%E5%9C%A8Linux%E8%BF%9C%E7%AB%AF%E6%9C%8D%E5%8A%A1%E5%99%A8%E4%B8%8A%E9%83%A8%E7%BD%B2%E4%BB%93%E5%BA%93-toc\" style=\"margin-left:0px\">\u521b\u5efa\u4ed3\u5e93 &amp;&amp; \u5982\u4f55\u5728Linux\u8fdc\u7aef\u670d\u52a1\u5668\u4e0a\u90e8\u7f72\u4ed3\u5e93<\/p>\n<p id=\"%E5%88%9B%E5%BB%BA%E4%BB%93%E5%BA%93-toc\" style=\"margin-left:80px\">\u521b\u5efa\u4ed3\u5e93<\/p>\n<p id=\"%E9%83%A8%E7%BD%B2-toc\" style=\"margin-left:80px\">\u90e8\u7f72<\/p>\n<p id=\"git%20%E6%93%8D%E4%BD%9C%E4%B8%89%E6%9D%BF%E6%96%A7-toc\" style=\"margin-left:0px\">git \u64cd\u4f5c\u4e09\u677f\u65a7<\/p>\n<p id=\"%E4%BB%80%E4%B9%88%E6%98%AFgit%20%26%20gitee%20%26%20github-toc\" style=\"margin-left:0px\">\u4ec0\u4e48\u662fgit &amp; gitee &amp; github<\/p>\n<p id=\"git%20%E4%B8%89%E6%9D%BF%E6%96%A7%E7%9A%84%E6%9C%AC%E8%B4%A8-toc\" style=\"margin-left:0px\">git \u4e09\u677f\u65a7\u7684\u672c\u8d28<\/p>\n<p id=\".gitignore%20%E6%98%AF%E4%BB%80%E4%B9%88-toc\" style=\"margin-left:0px\">.gitignore \u662f\u4ec0\u4e48<\/p>\n<p id=\"%E7%BB%93%E8%AF%AD-toc\" style=\"margin-left:0px\">\u7ed3\u8bed<\/p>\n<hr id=\"hr-toc\" \/>\n<h2 id=\"%E5%AE%89%E8%A3%85%20git\">\u5b89\u88c5 git<\/h2>\n<p>\u5982\u679c\u662f\u5728centos\u4e0b\u5b89\u88c5git\u7684\u8bdd&#xff0c;\u6211\u4eec\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528yum\u5b89\u88c5&#xff1a;<\/p>\n<p>sudo yum install -y git<\/p>\n<\/p>\n<h2 id=\"%E5%88%9B%E5%BB%BA%E4%BB%93%E5%BA%93%20%26%26%20%E5%A6%82%E4%BD%95%E5%9C%A8Linux%E8%BF%9C%E7%AB%AF%E6%9C%8D%E5%8A%A1%E5%99%A8%E4%B8%8A%E9%83%A8%E7%BD%B2%E4%BB%93%E5%BA%93\">\u521b\u5efa\u4ed3\u5e93 &amp;&amp; \u5982\u4f55\u5728Linux\u8fdc\u7aef\u670d\u52a1\u5668\u4e0a\u90e8\u7f72\u4ed3\u5e93<\/h2>\n<h4 id=\"%E5%88%9B%E5%BB%BA%E4%BB%93%E5%BA%93\">\u521b\u5efa\u4ed3\u5e93<\/h4>\n<p>\u9996\u5148\u6211\u4eec\u6253\u5f00gitee&#xff0c;\u5982\u4e0b\u56fe&#xff1a;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"388\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250528091631-6836d46f5bab0.png\" width=\"473\" \/><\/p>\n<p>\u5148\u662f\u6253\u5f00\u4e2a\u4eba\u4e3b\u9875&#xff0c;\u7136\u540e\u70b9\u51fb\u65b0\u5efa\u4ed3\u5e93<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"431\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250528091631-6836d46f7830d.png\" width=\"587\" \/><\/p>\n<p>\u7136\u540e\u6211\u4eec\u53ef\u4ee5\u6309\u7167\u4e0a\u9762\u7684\u914d\u7f6e\u6765\u914d\u7f6e\u81ea\u5df1\u7684\u4ed3\u5e93<\/p>\n<p>\u9700\u8981\u8bf4\u660e\u7684\u4e00\u70b9\u662f&#xff0c;\u4e00&#xff0c;\u521d\u59cb\u5316\u4ed3\u5e93\u4e2d\u7684\u8bed\u8a00\u586b\u4f60\u4eec\u81ea\u5df1\u6240\u5b66\u7684\u8bed\u8a00&#xff0c;\u6216\u8005\u662f\u4f60\u8981\u653e\u5728\u8fd9\u4e2a\u4ed3\u5e93\u4e2d\u7684\u9879\u76ee\u4e3b\u8981\u4f7f\u7528\u7684\u8bed\u8a00<\/p>\n<p>\u7b2c\u4e8c&#xff0c;\u8bbe\u7f6e\u6a21\u677f\u4e2d\u9009\u62e9\u7684readme\u6587\u4ef6&#xff0c;\u76f8\u5f53\u4e8e\u4e00\u4e2a\u4ecb\u7ecd\u8bf4\u660e&#xff0c;\u867d\u7136\u662f\u9700\u8981\u6211\u4eec\u81ea\u5df1\u540e\u9762\u53bb\u5b8c\u5584\u7684&#xff0c;\u5927\u4f53\u6837\u5f0f\u5982\u4e0b&#xff1a;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"504\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250528091632-6836d4700f03c.png\" width=\"572\" \/><\/p>\n<p>\u6700\u540e\u662f\u5206\u652f\u6a21\u578b&#xff0c;\u5176\u5b9e\u5982\u679c\u662f\u4f60\u4e00\u4e2a\u4eba\u7684\u4ed3\u5e93\u7684\u8bdd&#xff0c;\u5c31\u9009\u5355\u5206\u652f&#xff0c;\u56e0\u4e3a\u591a\u5206\u652f\u6216\u5176\u4ed6\u57fa\u672c\u90fd\u662f\u5927\u9879\u76ee\u624d\u9700\u8981\u7528\u5230\u7684&#xff0c;\u8fd9\u91cc\u4e5f\u4e0d\u505a\u89e3\u91ca&#xff0c;\u56e0\u4e3a\u4eca\u5929\u8fd9\u7bc7\u535a\u5ba2\u7684\u4e3b\u8981\u76ee\u7684\u5c31\u662f\u6559\u4f1a\u5927\u5bb6\u5982\u4f55\u7b80\u5355\u90e8\u7f72\u4e0e\u4f7f\u7528 git<\/p>\n<h4 id=\"%E9%83%A8%E7%BD%B2\">\u90e8\u7f72<\/h4>\n<p>\u6211\u4eec\u521a\u521b\u5efa\u597d\u4ed3\u5e93\u4e4b\u540e&#xff0c;\u4f1a\u51fa\u73b0\u8fd9\u6837\u4e00\u4e2a\u754c\u9762&#xff0c;\u5982\u4e0b\u56fe&#xff1a;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"867\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250528091632-6836d47083981.png\" width=\"1395\" \/><\/p>\n<p>\u6211\u4eec\u53ef\u4ee5\u770b\u5230\u6700\u53f3\u8fb9\u6709\u4e00\u4e2a\u514b\u9686\/\u4e0b\u8f7d\u7684\u6309\u952e&#xff0c;\u6211\u4eec\u70b9\u51fb\u4ed6&#xff1a;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"769\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250528091633-6836d471063ba.png\" width=\"1040\" \/><\/p>\n<p>\u63a5\u7740\u4f1a\u5f39\u51fa\u6765\u8fd9\u4e00\u6837\u4e00\u4e2a\u4e1c\u897f&#xff0c;\u8fd9\u5176\u5b9e\u5c31\u662f\u5728\u6559\u4f60\u5982\u4f55\u5728Linux\u4e91\u670d\u52a1\u5668\u4e0a\u90e8\u7f72\u4e86&#xff0c;\u6211\u4eec\u4e00\u4e2a\u4e00\u4e2a\u6765\u8bb2&#xff1a;<\/p>\n<p>\u5176\u5b9e\u771f\u6b63\u9700\u8981\u6211\u4eec\u505a\u5230\u7684\u64cd\u4f5c\u5c31\u4e24\u4e2a&#xff1a;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"168\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250528091633-6836d47163720.png\" width=\"875\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"124\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250528091633-6836d47179c60.png\" width=\"877\" \/><\/p>\n<p>\u6309\u7167\u8fd9\u4e2a\u987a\u5e8f\u4f9d\u6b21\u5728\u547d\u4ee4\u884c\u4e2d\u7c98\u8d34\u8fd9\u4e24\u4e2a\u547d\u4ee4<\/p>\n<p>\u7b2c\u4e00\u4e2a\u5176\u5b9e\u662f\u786e\u8ba4\u4f60\u7684\u7528\u6237\u540d\u548c\u90ae\u7bb1<\/p>\n<p>\u800c\u7b2c\u4e8c\u4e2a\u5c31\u662f git clone \u52a0\u7f51\u5740&#xff0c;\u53ea\u4e0d\u8fc7gitee\u8fd9\u4e2a\u7f51\u7ad9\u6bd4\u8f83\u597d&#xff0c;\u76f4\u63a5\u63d0\u4f9b\u4e86\u5b8c\u6574\u7684\u7ed9\u4f60\u590d\u5236\u7c98\u8d34<\/p>\n<p>\u901a\u8fc7\u8fd9\u4e24\u4e2a\u6b65\u9aa4&#xff0c;\u6211\u4eec\u5c31\u80fd\u591f\u5728Linux\u8fdc\u7aef\u673a\u5668\u4e0a\u6210\u529f\u90e8\u7f72\u4ed3\u5e93\u4e86<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"357\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250528091633-6836d4718e4b6.png\" width=\"1049\" \/><\/p>\n<p>&#xff08;\u7531\u4e8e\u4e3b\u5305\u4e4b\u524d\u5df2\u7ecf\u9a8c\u8bc1\u8fc7\u7528\u6237\u540d\u548c\u90ae\u7bb1\u4e86&#xff0c;\u6240\u4ee5\u8fd9\u91cc\u5c31\u6ca1\u6709\u8fd9\u4e00\u6b65&#xff09;<\/p>\n<p>\u800c\u63a5\u4e0b\u6765\u7684part&#xff0c;\u5219\u662f\u8fdb\u884c git \u4e0a\u4f20\u6587\u4ef6\u7684\u4e3b\u8981\u64cd\u4f5c<\/p>\n<\/p>\n<h2 id=\"git%20%E6%93%8D%E4%BD%9C%E4%B8%89%E6%9D%BF%E6%96%A7\">git \u64cd\u4f5c\u4e09\u677f\u65a7<\/h2>\n<p>1. git add \u6587\u4ef6\u540d \/ git add .<\/p>\n<p>2. git commit -m &#034;\u65e5\u5fd7&#034;<\/p>\n<p>3. git push<\/p>\n<p>\u63a5\u4e0b\u6765\u6211\u4eec\u5c31\u6765\u8be6\u7ec6\u8bb2\u4e00\u8bb2\u64cd\u4f5c\u7ec6\u8282&#xff08;\u81f3\u4e8e\u672c\u8d28\u6211\u4eec\u4f1a\u653e\u5230\u4e0b\u6587\u8fdb\u884c\u8bb2\u89e3&#xff09;<\/p>\n<p>\u5148\u662fgit add&#xff0c;\u9996\u5148\u6211\u4eec\u53ef\u4ee5\u6307\u5b9a\u67d0\u4e00\u4e2a\u6587\u4ef6\u8fdb\u884cadd&#xff0c;\u5f53\u7136\u4e5f\u53ef\u4ee5\u9009\u62e9\u7b2c\u4e8c\u79cd&#xff0c; . \u5c31\u4ee3\u8868\u6240\u6709\u80fdadd\u7684\u6587\u4ef6<\/p>\n<p>\u63a5\u7740\u662fgit commit&#xff0c;\u8fd9\u91cc\u6211\u4eec\u4e00\u5b9a\u8981\u5e26\u4e0a-m\u9009\u9879&#xff0c;\u800c\u4e14\u540e\u9762\u7684\u65e5\u5fd7\u5185\u5bb9\u5fc5\u987b\u8981\u5199&#xff0c;\u4e0d\u80fd\u4e3a\u7a7a<\/p>\n<p>\u6700\u540e\u5c31\u662fgit push&#xff0c;\u76f4\u63a5\u7528\u5373\u53ef&#xff0c;\u7528\u5b8c\u4e4b\u540e\u8981\u8f93\u5165\u4f60\u5728gitee\u4e0a\u7684\u7528\u6237\u540d\u548c\u5bc6\u7801<\/p>\n<\/p>\n<h2 id=\"%E4%BB%80%E4%B9%88%E6%98%AFgit%20%26%20gitee%20%26%20github\">\u4ec0\u4e48\u662fgit &amp; gitee &amp; github<\/h2>\n<p>\u6211\u4eec\u6765\u8bb2\u4e00\u4e2a\u5c0f\u6545\u4e8b&#xff0c;\u5c0fa\u662f\u4e00\u4e2a\u540c\u5b66&#xff0c;\u4e34\u8fd1\u671f\u672b&#xff0c;\u4ed6\u9700\u8981\u4ea4\u5b9e\u9a8c\u62a5\u544a\u7ed9\u8001\u5e08<\/p>\n<p>\u6709\u4e00\u5929&#xff0c;\u5c0fa\u628a\u9879\u76ee\u505a\u5b8c\u4e86&#xff0c;\u7136\u540e\u4ea4\u7ed9\u8001\u5e08\u8fdb\u884c\u67e5\u770b&#xff0c;\u4f46\u662f\u8001\u5e08\u8bf4\u8fd9\u4e2a\u4e0d\u884c&#xff0c;\u6253\u56de\u53bb\u91cd\u505a<\/p>\n<p>\u63a5\u7740\u662f\u7b2c\u4e8c\u6b21&#xff0c;\u7b2c\u4e09\u6b21&#xff0c;\u7b2c\u56db\u6b21&#xff0c;\u6700\u540e\u9762\u8001\u5e08\u5728\u770b\u5230\u7b2c\u56db\u6b21\u7684\u6210\u54c1\u4e4b\u540e&#xff0c;\u7075\u673a\u4e00\u52a8&#xff0c;\u7a81\u7136\u89c9\u5f97\u7b2c\u4e00\u6b21\u7684\u7ed3\u679c\u6700\u597d\u770b&#xff0c;\u6240\u4ee5\u5c31\u548c\u5c0fa\u8bf4\u628a\u7b2c\u4e00\u6b21\u7684\u62ff\u6765\u505a\u6210\u679c\u5c31\u597d\u4e86<\/p>\n<p>\u4f46\u662f\u8fd9\u65f6\u5019\u5c0fa\u5c31\u72af\u96be\u4e86&#xff0c;\u56e0\u4e3a\u4ed6\u5e76\u6ca1\u6709\u4fdd\u5b58\u4e4b\u524d\u7684\u51e0\u7248<\/p>\n<p>\u5c0f w \u77e5\u9053\u4e86\u8fd9\u4ef6\u4e8b\u60c5\u4e4b\u540e&#xff0c;\u5c31\u5b66\u806a\u660e\u4e86&#xff0c;\u4ed6\u6bcf\u4e00\u6b21\u7ed9\u8001\u5e08\u4ea4\u5b8c\u5b9e\u9a8c\u62a5\u544a\u4e4b\u540e\u90fd\u4f1a\u5c06\u8fd9\u4e00\u7248\u7684\u5b9e\u9a8c\u62a5\u544a\u653e\u8fdb\u4e00\u4e2a\u6587\u4ef6\u5939\u91cc\u9762&#xff0c;\u6700\u540e\u5f53\u4ed6\u9047\u5230\u548c\u5c0fa\u540c\u6837\u7684\u95ee\u9898\u7684\u65f6\u5019&#xff0c;\u4ed6\u5c31\u80fd\u4ece\u5bb9\u5e94\u5bf9\u4e86<\/p>\n<p>\u540e\u6765&#xff0c;<span style=\"color:#fe2c24\">\u4ed6\u5c31\u60f3\u7740\u80fd\u4e0d\u80fd\u5199\u4e00\u4e2a\u8f6f\u4ef6<\/span>&#xff0c;\u6765\u5e2e\u52a9\u5168\u73ed\u751a\u81f3\u662f\u5168\u6821\u7684\u540c\u5b66\u7ba1\u7406\u4ed6\u4eec\u7684\u5b9e\u9a8c\u62a5\u544a<\/p>\n<p>\u5f53\u4ed6\u5199\u597d\u4e4b\u540e&#xff0c;\u5c31\u5728\u6821\u56ed\u5899\u4e0a\u8bf4&#xff0c;\u53ea\u8981\u4e0b\u8f7d\u8fd9\u4e2a\u8f6f\u4ef6\u7684\u5b89\u88c5\u5305&#xff0c;\u5c31\u80fd\u4e0b\u8f7d\u4f7f\u7528\u4e86<\/p>\n<p>\u4f46\u662f\u540e\u6765\u4ed6\u53c8\u60f3\u8fd9\u6837\u592a\u632b\u4e86&#xff0c;\u6240\u4ee5\u53c8\u4e13\u95e8<span style=\"color:#fe2c24\">\u5199\u4e86\u4e00\u4e2a\u7f51\u7ad9\u5728\u8fdc\u7aef\u7ba1\u7406&#xff0c;\u5e76\u4e14\u8fde\u4e0a\u7f51\u7edc\u624d\u80fd\u4f7f\u7528<\/span><\/p>\n<p>\u73b0\u5728\u6211\u4eec\u5c06\u89d2\u8272\u4ee3\u5165\u4e00\u4e0b<\/p>\n<p>\u7b2c\u4e00\u5904\u6807\u7ea2\u7684\u5730\u65b9&#xff0c;\u90a3\u4e2a\u8f6f\u4ef6\u5c31\u662f\u6211\u4eec\u7684git<\/p>\n<p>\u7b2c\u4e8c\u5904\u6807\u7ea2\u7684\u5730\u65b9&#xff0c;\u5c31\u662fgitee&#xff08;github\u540c\u7406&#xff09;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"183\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250528091633-6836d471c1665.png\" width=\"633\" \/><\/p>\n<p>\u6211\u4eec\u770b\u5230\u4e0a\u9762\u8fd9\u5f20\u56fe&#xff0c;\u8fd9\u662f\u524d\u6587\u6211\u4eec\u5c06\u8fdc\u7aef\u4ed3\u5e93\u90e8\u7f72\u5728Linux\u4e91\u670d\u52a1\u5668\u4e4b\u540e\u7684\u6837\u5b50&#xff0c;\u6211\u4eec\u53ef\u4ee5\u770b\u5230&#xff0c;\u8fd9\u91cc\u9762\u662f\u6709\u4e00\u4e2a\u9690\u85cf\u6587\u4ef6\u7684&#xff0c;\u53eb\u505a .git&#xff0c;\u8fd9\u5176\u5b9e\u5c31\u662f\u4e00\u4e2a\u672c\u5730\u4ed3\u5e93&#xff0c;\u4e5f\u5c31\u662f\u8bf4&#xff0c;git \u5176\u5b9e\u53ef\u4ee5\u4e0d\u8054\u7f51&#xff0c;\u50cf\u4e00\u4e2a\u5355\u673a\u6e38\u620f\u4e00\u6837\u5728\u672c\u5730\u5c31\u80fd\u7ba1\u7406\u6587\u4ef6<\/p>\n<p>\u800c\u5f53\u6211\u4eec\u4e0a\u4f20\u4e86\u4e00\u4e2a\u6587\u4ef6\u4e4b\u540e&#xff0c;\u6211\u4eec\u5728gitee\u4e0a\u5c31\u80fd\u770b\u5230&#xff08;\u524d\u63d0\u662fpush&#xff0c;\u5426\u5219\u5c31\u770b\u4e0d\u5230&#xff09;&#xff1a;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"333\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250528091633-6836d471d4cae.png\" width=\"852\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"417\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250528091634-6836d472026e2.png\" width=\"574\" \/><\/p>\n<p>\u800c\u6211\u4eec\u5728\u672c\u5730\u4e5f\u80fd\u901a\u8fc7\u67e5\u770b\u65e5\u5fd7\u6765\u67e5\u770b\u4e0a\u4f20\u8bb0\u5f55&#xff1a;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"323\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250528091634-6836d4723f26c.png\" width=\"555\" \/><\/p>\n<\/p>\n<h2 id=\"git%20%E4%B8%89%E6%9D%BF%E6%96%A7%E7%9A%84%E6%9C%AC%E8%B4%A8\">git \u4e09\u677f\u65a7\u7684\u672c\u8d28<\/h2>\n<p>\u6211\u4eec\u53ef\u4ee5\u60f3\u8c61\u6709\u4e09\u4e2a\u4ed3\u5e93<\/p>\n<p>\u7b2c\u4e00\u4e2a\u662f\u6682\u5b58\u533a&#xff0c;\u5f53\u6211\u4eecgit add \u4e4b\u540e\u6587\u4ef6\u5c31\u4f1a\u88ab\u653e\u5230\u8fd9\u91cc\u9762<\/p>\n<p>\u5176\u5b9e\u8fd9\u4e2a\u662f<span style=\"color:#fe2c24\">\u65b9\u4fbf\u6211\u4eec\u53cd\u6094\u7528\u7684<\/span>&#xff0c;\u5982\u679c\u4f60\u6709\u4e00\u4e9b\u5f88\u632b\u7684\u64cd\u4f5c\u4e5f\u4e0a\u4f20\u4e0a\u53bb\u4e86&#xff0c;\u5373\u4f7f\u662fgit commit&#xff0c;\u4e5f\u4f1a\u88ab\u4eba\u770b\u5230&#xff0c;\u56e0\u4e3a\u6709\u65e5\u5fd7&#xff0c;\u800c\u5f53\u6211\u4eec\u653e\u5728add\u8fd9\u4e2a\u6682\u5b58\u533a\u91cc\u9762\u7684\u65f6\u5019&#xff0c;\u6211\u4eec\u662f\u53ef\u4ee5\u901a\u8fc7<span style=\"color:#fe2c24\">git reset<\/span>\u8fdb\u884c\u56de\u9000\u7684<\/p>\n<p>\u7b2c\u4e8c\u4e2a\u662f\u4ed3\u5e93&#xff0c;\u6211\u4eecgit commit\u4e4b\u540e\u6587\u4ef6\u5c31\u4f1a\u88ab\u653e\u5230\u8fd9\u4e2a\u5730\u65b9&#xff0c;\u65b9\u4fbf\u672c\u5730\u7ba1\u7406<\/p>\n<p>\u6700\u540e&#xff0c;\u5c31\u662f\u8fdc\u7aef\u4ed3\u5e93\u4e86&#xff0c;git push\u4e4b\u540e\u5c31\u4f1a\u6765\u5230\u8fd9\u91cc&#xff0c;\u6211\u4eec\u5728gitee\u4e0a\u5c31\u80fd\u770b\u5230\u5bf9\u5e94\u7684\u4fe1\u606f\u4e86<\/p>\n<\/p>\n<h2 id=\".gitignore%20%E6%98%AF%E4%BB%80%E4%B9%88\">.gitignore \u662f\u4ec0\u4e48<\/h2>\n<p>\u6211\u4eec\u518d\u6b21\u770b\u770b\u4ed3\u5e93\u4e0b\u6709\u4ec0\u4e48\u6587\u4ef6&#xff1a;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"259\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250528091634-6836d47254a3f.png\" width=\"605\" \/><\/p>\n<p>\u6211\u4eec\u4f1a\u770b\u5230\u6709\u4e00\u4e2a.gitignore \u6587\u4ef6&#xff0c;\u8fd9\u4e2a\u6587\u4ef6\u662f\u5e72\u4ec0\u4e48\u7684\u5462&#xff1f;<\/p>\n<p>\u9996\u5148\u6211\u4eec\u9700\u8981\u660e\u767d\u4e00\u4e2a\u60c5\u666f&#xff0c;\u5f53\u6211\u4eec\u7f16\u8bd1\u5b8c\u4e86\u6587\u4ef6\u4e4b\u540e&#xff0c;\u4f1a\u6709\u5f88\u591a\u5947\u5947\u602a\u602a\u7684\u6587\u4ef6&#xff0c;\u8fd9\u70b9\u5982\u679c\u4f60\u5728vs2019\u6216\u80052022\u4e0a\u9762\u7f16\u5199\u8fc7\u4ee3\u7801\u5e94\u8be5\u6709\u770b\u5230\u8fc7&#xff1a; <img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"419\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250528091634-6836d4726e287.png\" width=\"972\" \/><\/p>\n<p>\u6bd4\u5982\u4e0a\u56fe\u8fd9\u79cd<\/p>\n<p>\u4f46\u5176\u5b9e\u5f88\u591a\u6587\u4ef6\u6211\u4eec\u662f\u5e76\u4e0d\u9700\u8981\u7684&#xff0c;\u6211\u4eec\u771f\u6b63\u9700\u8981\u7ba1\u7406\u7684\u662f\u6211\u4eec\u7684\u4ee3\u7801&#xff0c;.cpp\u3001.c\u3001.h\u3001makefile\u8fd9\u6837\u7684\u6587\u4ef6&#xff0c;\u5176\u4ed6\u50cf.obj&#xff0c;.log\u8fd9\u4e9b\u6211\u4eec\u90fd\u662f\u4e0d\u9700\u8981\u7684<\/p>\n<p><span style=\"color:#fe2c24\">\u800c\u6211\u4eec\u7684 .gitignore \u5c31\u662f\u8d1f\u8d23\u8fc7\u6ee4\u8fd9\u4e9b\u6587\u4ef6\u7684<\/span><\/p>\n<p>\u6211\u4eec\u53ef\u4ee5\u7528vim\u6253\u5f00 .gitignore \u770b\u770b<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"585\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250528091634-6836d47298ee5.png\" width=\"486\" \/><\/p>\n<p>\u6211\u4eec\u53ef\u4ee5\u770b\u5230&#xff0c;\u91cc\u9762\u90fd\u662f\u4e00\u4e9b\u6587\u4ef6\u540e\u7f00\u540d&#xff0c;\u8fd9\u4e5f\u5c31\u610f\u5473\u7740&#xff0c;\u5982\u679c\u662f\u7b26\u5408\u4e0a\u9762\u5217\u51fa\u6765\u7684\u6587\u4ef6&#xff0c;\u7edf\u7edf\u4f1a\u88ab\u62e6\u4e0b\u4e0d\u7ed9\u4e0a\u4f20&#xff0c;\u56e0\u4e3a\u8fd9\u4e9b\u6587\u4ef6\u662f\u88abignore&#xff08;\u5ffd\u7565&#xff09;\u7684<\/p>\n<\/p>\n<h2 id=\"%E7%BB%93%E8%AF%AD\">\u7ed3\u8bed<\/h2>\n<p>\u8fd9\u7bc7\u6587\u7ae0\u5230\u8fd9\u91cc\u5c31\u7ed3\u675f\u5566&#xff01;&#xff01;~(&#xffe3;\u25bd&#xffe3;)~*<\/p>\n<p>\u5982\u679c\u89c9\u5f97\u5bf9\u4f60\u6709\u5e2e\u52a9\u7684&#xff0c;\u53ef\u4ee5\u591a\u591a\u5173\u6ce8\u4e00\u4e0b\u5594<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb929\u6b21\uff0c\u70b9\u8d5e14\u6b21\uff0c\u6536\u85cf25\u6b21\u3002\u5b89\u88c5 git  \u3001  \u521b\u5efa\u4ed3\u5e93 &amp;&amp; \u5982\u4f55\u5728Linux\u8fdc\u7aef\u670d\u52a1\u5668\u4e0a\u90e8\u7f72\u4ed3\u5e93  \u3001  git \u64cd\u4f5c\u4e09\u677f\u65a7  \u3001  \u4ec0\u4e48\u662fgit &amp;  \u3001  gitee &amp; github  \u3001  git \u4e09\u677f\u65a7\u7684\u672c\u8d28  \u3001  .gitignore \u662f\u4ec0\u4e48<\/p>\n","protected":false},"author":2,"featured_media":40367,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[371],"topic":[],"class_list":["post-40383","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-371"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u3010Linux \u5b66\u4e60\u8ba1\u5212\u3011- git \u5728Linux\u8fdc\u7aef\u670d\u52a1\u5668\u4e0a\u7684\u90e8\u7f72\u4e0e\u7b80\u5355\u4f7f\u7528 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/40383.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u3010Linux \u5b66\u4e60\u8ba1\u5212\u3011- git \u5728Linux\u8fdc\u7aef\u670d\u52a1\u5668\u4e0a\u7684\u90e8\u7f72\u4e0e\u7b80\u5355\u4f7f\u7528 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb929\u6b21\uff0c\u70b9\u8d5e14\u6b21\uff0c\u6536\u85cf25\u6b21\u3002\u5b89\u88c5 git \u3001 \u521b\u5efa\u4ed3\u5e93 &amp;&amp; \u5982\u4f55\u5728Linux\u8fdc\u7aef\u670d\u52a1\u5668\u4e0a\u90e8\u7f72\u4ed3\u5e93 \u3001 git \u64cd\u4f5c\u4e09\u677f\u65a7 \u3001 \u4ec0\u4e48\u662fgit &amp; \u3001 gitee &amp; github \u3001 git \u4e09\u677f\u65a7\u7684\u672c\u8d28 \u3001 .gitignore \u662f\u4ec0\u4e48\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/40383.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-05-28T09:16:35+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250528091629-6836d46dc2862.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/40383.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/40383.html\",\"name\":\"\u3010Linux \u5b66\u4e60\u8ba1\u5212\u3011- git \u5728Linux\u8fdc\u7aef\u670d\u52a1\u5668\u4e0a\u7684\u90e8\u7f72\u4e0e\u7b80\u5355\u4f7f\u7528 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-05-28T09:16:35+00:00\",\"dateModified\":\"2025-05-28T09:16:35+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/40383.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/40383.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/40383.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u3010Linux \u5b66\u4e60\u8ba1\u5212\u3011-- git \u5728Linux\u8fdc\u7aef\u670d\u52a1\u5668\u4e0a\u7684\u90e8\u7f72\u4e0e\u7b80\u5355\u4f7f\u7528\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u3010Linux \u5b66\u4e60\u8ba1\u5212\u3011- git \u5728Linux\u8fdc\u7aef\u670d\u52a1\u5668\u4e0a\u7684\u90e8\u7f72\u4e0e\u7b80\u5355\u4f7f\u7528 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/40383.html","og_locale":"zh_CN","og_type":"article","og_title":"\u3010Linux \u5b66\u4e60\u8ba1\u5212\u3011- git \u5728Linux\u8fdc\u7aef\u670d\u52a1\u5668\u4e0a\u7684\u90e8\u7f72\u4e0e\u7b80\u5355\u4f7f\u7528 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb929\u6b21\uff0c\u70b9\u8d5e14\u6b21\uff0c\u6536\u85cf25\u6b21\u3002\u5b89\u88c5 git \u3001 \u521b\u5efa\u4ed3\u5e93 &amp;&amp; \u5982\u4f55\u5728Linux\u8fdc\u7aef\u670d\u52a1\u5668\u4e0a\u90e8\u7f72\u4ed3\u5e93 \u3001 git \u64cd\u4f5c\u4e09\u677f\u65a7 \u3001 \u4ec0\u4e48\u662fgit &amp; \u3001 gitee &amp; github \u3001 git \u4e09\u677f\u65a7\u7684\u672c\u8d28 \u3001 .gitignore \u662f\u4ec0\u4e48","og_url":"https:\/\/www.wsisp.com\/helps\/40383.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-05-28T09:16:35+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250528091629-6836d46dc2862.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/40383.html","url":"https:\/\/www.wsisp.com\/helps\/40383.html","name":"\u3010Linux \u5b66\u4e60\u8ba1\u5212\u3011- git \u5728Linux\u8fdc\u7aef\u670d\u52a1\u5668\u4e0a\u7684\u90e8\u7f72\u4e0e\u7b80\u5355\u4f7f\u7528 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-05-28T09:16:35+00:00","dateModified":"2025-05-28T09:16:35+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/40383.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/40383.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/40383.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u3010Linux \u5b66\u4e60\u8ba1\u5212\u3011-- git \u5728Linux\u8fdc\u7aef\u670d\u52a1\u5668\u4e0a\u7684\u90e8\u7f72\u4e0e\u7b80\u5355\u4f7f\u7528"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/40383","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=40383"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/40383\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/40367"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=40383"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=40383"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=40383"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=40383"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}