{"id":21525,"date":"2024-11-19T11:06:13","date_gmt":"2024-11-19T03:06:13","guid":{"rendered":"https:\/\/fwq.ai\/blog\/21525\/"},"modified":"2024-11-19T11:06:13","modified_gmt":"2024-11-19T03:06:13","slug":"git-bash%e6%80%8e%e4%b9%88%e7%94%a8","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/21525\/","title":{"rendered":"git bash\u600e\u4e48\u7528"},"content":{"rendered":"<blockquote><p>\n  windows \u7cfb\u7edf\u4e0a\u4f7f\u7528 git bash \u4e0e git \u4ea4\u4e92\uff1a\u5b89\u88c5 git for windows \u5e76\u9009\u62e9\u4f7f\u7528 git bash \u4f5c\u4e3a\u9ed8\u8ba4 shell\u3002\u521d\u59cb\u5316 git \u4ed3\u5e93\u3001\u6dfb\u52a0\u6587\u4ef6\u5230\u6682\u5b58\u533a\u5e76\u63d0\u4ea4\u66f4\u6539\u3002\u4f7f\u7528 git pull \u548c git push \u547d\u4ee4\u62c9\u53d6\u548c\u63a8\u9001\u8fdc\u7a0b\u4ed3\u5e93\u66f4\u65b0\u3002\u7ba1\u7406\u5206\u652f\uff1a\u521b\u5efa\u65b0\u5206\u652f\u3001\u5207\u6362\u5206\u652f\u3001\u5408\u5e76\u5206\u652f\u548c\u5220\u9664\u5206\u652f\u3002\u4e0e\u8fdc\u7a0b\u4ed3\u5e93\u4ea4\u4e92\uff1a\u514b\u9686\u3001\u6dfb\u52a0\u3001\u62c9\u53d6\u548c\u63a8\u9001\u66f4\u6539\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202405\/30\/2024053023153797894.jpg\" class=\"aligncenter\" title=\"git bash\u600e\u4e48\u7528\u63d2\u56fe\" alt=\"git bash\u600e\u4e48\u7528\u63d2\u56fe\" \/><\/p>\n<p><strong>Git Bash \u4f7f\u7528\u6307\u5357<\/strong><\/p>\n<p><strong>\u5f00\u573a\uff1a<\/strong><br \/>Git Bash \u662f Windows \u7cfb\u7edf\u4e0a\u7528\u4e8e\u4e0e Git \u7248\u672c\u63a7\u5236\u7cfb\u7edf\u4ea4\u4e92\u7684\u547d\u4ee4\u884c shell\u3002\u5b83\u63d0\u4f9b\u4e86\u4e00\u4e2a\u7c7b\u4f3c\u4e8e Unix \u7684\u73af\u5883\uff0c\u7528\u4e8e\u6267\u884c Git \u547d\u4ee4\u3002<\/p>\n<p><strong>\u5b89\u88c5\uff1a<\/strong><\/p>\n<ol>\n<li>\u524d\u5f80 Git for Windows \u5b98\u65b9\u7f51\u7ad9\uff1ahttps:\/\/-for-windows.org\/<\/li>\n<li>\u4e0b\u8f7d\u5e76\u5b89\u88c5\u6700\u65b0\u7248\u672c\u7684 Git for Windows \u5b89\u88c5\u7a0b\u5e8f\u3002<\/li>\n<li>\u786e\u4fdd\u9009\u4e2d\u201c\u4f7f\u7528 Git Bash \u4f5c\u4e3a Windows \u9ed8\u8ba4 shell\u201d\u9009\u9879\u3002<\/li>\n<\/ol>\n<p><strong>\u6253\u5f00 Git Bash\uff1a<\/strong><\/p>\n<ol>\n<li>\u5728 Windows \u641c\u7d22\u680f\u4e2d\u641c\u7d22\u201cGit Bash\u201d\u3002<\/li>\n<li>\u70b9\u51fb\u5e94\u7528\u7a0b\u5e8f\u4ee5\u5c06\u5176\u6253\u5f00\u3002<\/li>\n<\/ol>\n<p><strong>\u57fa\u672c\u7528\u6cd5\uff1a<\/strong><\/p>\n<ol>\n<li> <strong>\u521d\u59cb\u5316 Git \u4ed3\u5e93\uff1a<\/strong>git init<\/li>\n<li> <strong>\u6dfb\u52a0\u6587\u4ef6\u5230\u6682\u5b58\u533a\uff1a<\/strong>git add .<\/li>\n<li> <strong>\u63d0\u4ea4\u66f4\u6539\uff1a<\/strong>git commit -m &#8220;\u63d0\u4ea4\u4fe1\u606f&#8221;<\/li>\n<li> <strong>\u62c9\u53d6\u8fdc\u7a0b\u4ed3\u5e93\u7684\u66f4\u65b0\uff1a<\/strong>git pull<\/li>\n<li> <strong>\u63a8\u9001\u672c\u5730\u66f4\u6539\u5230\u8fdc\u7a0b\u4ed3\u5e93\uff1a<\/strong>git push<\/li>\n<\/ol>\n<p><strong>\u5176\u4ed6\u5e38\u7528\u547d\u4ee4\uff1a<\/strong><\/p>\n<ul>\n<li> <strong>\u67e5\u770b\u7248\u672c\u5386\u53f2\uff1a<\/strong>git log<\/li>\n<li> <strong>\u67e5\u770b\u5f53\u524d\u5206\u652f\uff1a<\/strong>git branch<\/li>\n<li> <strong>\u521b\u5efa\u65b0\u5206\u652f\uff1a<\/strong>git branch <\/li>\n<li> <strong>\u5408\u5e76\u5206\u652f\uff1a<\/strong>git merge <\/li>\n<li> <strong>\u89e3\u51b3\u51b2\u7a81\uff1a<\/strong>git mergetool<\/li>\n<li> <strong>\u67e5\u770b\u6587\u4ef6\u5dee\u5f02\uff1a<\/strong>git diff<\/li>\n<li> <strong>\u64a4\u9500\u66f4\u6539\uff1a<\/strong>git reset HEAD~1<\/li>\n<\/ul>\n<p><strong>\u5206\u652f\u7ba1\u7406\uff1a<\/strong><br \/>Git Bash \u5141\u8bb8\u60a8\u7ba1\u7406\u591a\u4e2a\u5206\u652f\u3002\u60a8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<ul>\n<li> <strong>\u521b\u5efa\u65b0\u5206\u652f\uff1a<\/strong>git branch <\/li>\n<li> <strong>\u5207\u6362\u5230\u53e6\u4e00\u4e2a\u5206\u652f\uff1a<\/strong>git checkout <\/li>\n<li> <strong>\u5408\u5e76\u5206\u652f\uff1a<\/strong>git merge <\/li>\n<li> <strong>\u5220\u9664\u5206\u652f\uff1a<\/strong>git branch -d <\/li>\n<\/ul>\n<p><strong>\u8fdc\u7a0b\u4ed3\u5e93\uff1a<\/strong><br \/>Git Bash \u53ef\u7528\u4e8e\u4e0e\u8fdc\u7a0b\u4ed3\u5e93\uff08\u4f8b\u5982 GitHub\uff09\u4ea4\u4e92\u3002\u60a8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<ul>\n<li> <strong>\u514b\u9686\u8fdc\u7a0b\u4ed3\u5e93\uff1a<\/strong>git clone <\/li>\n<li> <strong>\u6dfb\u52a0\u8fdc\u7a0b\u4ed3\u5e93\uff1a<\/strong>git remote add <\/li>\n<li> <strong>\u62c9\u53d6\u8fdc\u7a0b\u4ed3\u5e93\u7684\u66f4\u65b0\uff1a<\/strong>git pull <\/li>\n<li> <strong>\u63a8\u9001\u672c\u5730\u66f4\u6539\u5230\u8fdc\u7a0b\u4ed3\u5e93\uff1a<\/strong>git push <\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662f bash\u600e\u4e48\u7528\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>windows \u7cfb\u7edf\u4e0a\u4f7f\u7528 git bash \u4e0e git \u4ea4\u4e92\uff1a\u5b89\u88c5 git for windows \u5e76\u9009\u62e9\u4f7f\u7528 git bash \u4f5c\u4e3a\u9ed8\u8ba4 shell\u3002\u521d\u59cb\u5316 git \u4ed3\u5e93\u3001\u6dfb\u52a0\u6587\u4ef6\u5230\u6682\u5b58\u533a\u5e76\u63d0\u4ea4\u66f4\u6539\u3002\u4f7f\u7528 git pull \u548c git push \u547d\u4ee4\u62c9\u53d6\u548c\u63a8\u9001\u8fdc\u7a0b\u4ed3\u5e93\u66f4\u65b0\u3002\u7ba1\u7406\u5206\u652f\uff1a\u521b\u5efa\u65b0\u5206\u652f\u3001\u5207\u6362\u5206\u652f\u3001\u5408\u5e76\u5206\u652f\u548c\u5220\u9664\u5206\u652f\u3002\u4e0e\u8fdc\u7a0b\u4ed3\u5e93\u4ea4\u4e92\uff1a\u514b\u9686\u3001\u6dfb\u52a0\u3001\u62c9\u53d6\u548c\u63a8\u9001\u66f4\u6539\u3002 Git Bash \u4f7f\u7528\u6307\u5357 \u5f00\u573a\uff1aGit Bash \u662f Windows \u7cfb\u7edf\u4e0a\u7528\u4e8e\u4e0e Git \u7248\u672c\u63a7\u5236\u7cfb\u7edf\u4ea4\u4e92\u7684\u547d\u4ee4\u884c shell\u3002\u5b83\u63d0\u4f9b\u4e86\u4e00\u4e2a\u7c7b\u4f3c\u4e8e Unix \u7684\u73af\u5883\uff0c\u7528\u4e8e\u6267\u884c Git \u547d\u4ee4\u3002 \u5b89\u88c5\uff1a \u524d\u5f80 Git for Windows \u5b98\u65b9\u7f51\u7ad9\uff1ahttps:\/\/-for-windows.org\/ \u4e0b\u8f7d\u5e76\u5b89\u88c5\u6700\u65b0\u7248\u672c\u7684 Git for Windows \u5b89\u88c5\u7a0b\u5e8f\u3002 \u786e\u4fdd\u9009\u4e2d\u201c\u4f7f\u7528 Git Bash \u4f5c\u4e3a Windows \u9ed8\u8ba4 [&hellip;]<\/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-21525","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/21525","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=21525"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/21525\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=21525"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=21525"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=21525"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}