{"id":37376,"date":"2023-07-19T18:36:53","date_gmt":"2023-10-28T15:10:11","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/git%e5%92%8cgithub%e6%a6%82%e8%bf%b0\/"},"modified":"2024-04-30T14:21:22","modified_gmt":"2024-04-30T06:21:22","slug":"git%e5%92%8cgithub%e6%a6%82%e8%bf%b0","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/git%e5%92%8cgithub%e6%a6%82%e8%bf%b0\/","title":{"rendered":"Git\u548cGitHub\u6982\u8ff0"},"content":{"rendered":"<h2>Git \u662f\u4e00\u4e2a\u7248\u672c\u63a7\u5236\u7cfb\u7edf\u3002<\/h2>\n<p>\u8fd9\u662f\u4e00\u4e2a\u5206\u6563\u5f0f\u7248\u672c\u63a7\u5236\u7cfb\u7edf\u3002<br \/>\n\u88ab\u79f0\u4e3a\u5206\u6563\u5f0f\u7248\u672c\u63a7\u5236\u7cfb\u7edf\uff0c\u662f\u56e0\u4e3a\u5177\u5907\u4ee5\u4e0b\u7279\u5f81\u3002<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">\u53e4\u3044\u30d0\u30fc\u30b8\u30e7\u30f3\u306b\u7c21\u5358\u306b\u623b\u305b\u308b<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">\u65b0\u65e7\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u4e00\u5143\u7ba1\u7406\u3067\u304d\u308b<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">\u7de8\u96c6\u3057\u305f\u5c65\u6b74\u3092\u8907\u6570\u4eba\u3067\u5171\u6709\u3067\u304d\u308b<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\u8907\u6570\u4eba\u3067\u4fee\u6b63\u3057\u305f\u90e8\u5206\u3092\u4e00\u3064\u306b\u7d71\u5408\u3067\u304d\u308b<\/ul>\n<p>\u7b80\u5355\u6765\u8bf4\uff0c\u5b83\u662f\u4e00\u4e2a\u53ef\u4ee5\u7b80\u5316\u6587\u4ef6\u7248\u672c\u7ba1\u7406\u7684\u5de5\u5177\u3002<\/p>\n<p>\u901a\u8fc7\u4f7f\u7528Git\u7ba1\u7406\u7684\u6587\u4ef6\u53ef\u4ee5\u5728\u8ba1\u7b97\u673a\u4e0a\u7ba1\u7406\u6587\u4ef6\u7684\u7f16\u8f91\u5386\u53f2\uff0c\u8fd9\u6837\u5c31\u53ef\u4ee5\u4fdd\u7559\u7f16\u8f91\u4e4b\u524d\u7684\u6587\u4ef6\uff0c\u540c\u65f6\u4fdd\u5b58\u65b0\u7f16\u8f91\u7684\u6587\u4ef6\u3002\u56e0\u6b64\uff0c\u53ef\u4ee5\u8f7b\u677e\u5b9e\u73b0\u7248\u672c\u7ba1\u7406\u3002<\/p>\n<h2>GitHub\u662f\u4ec0\u4e48<\/h2>\n<p>GitHub\u662f\u4f7f\u7528Git\u673a\u5236\u7684\u7f51\u7edc\u670d\u52a1\u7684\u540d\u79f0\uff0c\u5b83\u5141\u8bb8\u5168\u4e16\u754c\u7684\u4eba\u4eec\u5b58\u50a8\u548c\u516c\u5f00\u81ea\u5df1\u7684\u4f5c\u54c1\uff08\u7a0b\u5e8f\u4ee3\u7801\u548c\u8bbe\u8ba1\u6570\u636e\u7b49\uff09\u3002\u6b63\u5982\u540d\u5b57\u6240\u793a\uff0cGitHub\u4ee3\u8868\u7740Git\u7684\u4e2d\u5fc3\u548c\u805a\u5408\u4e4b\u610f\u3002<\/p>\n<h2>Git\u7684\u57fa\u672c\u672f\u8bed<\/h2>\n<h3>\u4ee3\u7801\u5e93 (code repository)<\/h3>\n<p>\u4ed3\u5e93\u662f\u7528\u6765\u5b58\u653e\u6587\u4ef6\u548c\u76ee\u5f55\u7684\u5b58\u50a8\u7a7a\u95f4\u3002<\/p>\n<dl>&#8211; \u8fdc\u7a0b\u4ed3\u5e93\uff1a\u5c06\u5176\u8bbe\u7f6e\u5728\u7279\u5b9a\u670d\u52a1\u5668\u4e0a\uff0c\u4f9b\u591a\u4eba\u5171\u4eab\u7684\u4ed3\u5e93\u3002<\/dl>\n<p>&nbsp;<\/p>\n<dl>&#8211; \u672c\u5730\u4ed3\u5e93\uff1a\u4e3a\u6bcf\u4e2a\u7528\u6237\u8bbe\u7f6e\u7684\uff0c\u5728\u4e2a\u4eba\u7535\u8111\u4e0a\u53ef\u7f16\u8f91\u7684\u4ed3\u5e93\u3002<\/dl>\n<h3>\u5206\u652f<\/h3>\n<p>\u5206\u652f\u662f\u6307\u5c06\u6587\u4ef6\u7684\u7f16\u8f91\u5386\u53f2\u5206\u53c9\u8bb0\u5f55\u7684\u529f\u80fd\u3002<\/p>\n<h3>\u63d0\u4ea4(commit)<\/h3>\n<p>\u63d0\u4ea4(commit)\u6307\u7684\u662f\u5c06\u6587\u4ef6\u6216\u76ee\u5f55\u7684\u7f16\u8f91\u5de5\u4f5c\u8bb0\u5f55\u5230\u672c\u5730\u4ed3\u5e93\u6240\u9700\u7684\u64cd\u4f5c\u3002<\/p>\n<h3>\u5de5\u4f5c\u533a\u548c\u7d22\u5f15<\/h3>\n<p>\u5de5\u4f5c\u533a\uff08Worktree\uff09\u662f\u6307\u7528\u6237\u6b63\u5728\u7f16\u8f91\u7684\u5de5\u4f5c\u76ee\u5f55\u3002<\/p>\n<p>\u7d22\u5f15\u662f\u5de5\u4f5c\u533a\u548c\u672c\u5730\u4ed3\u5e93\u4e4b\u95f4\u7684\u4e2d\u95f4\u533a\u57df\uff0c\u7528\u4f5c\u5de5\u4f5c\u4f4d\u7f6e\u548c\u5b58\u50a8\u4f4d\u7f6e\u3002<\/p>\n<h3>\u63a8\u9001<\/h3>\n<p>Push\u662f\u6307\u5c06\u672c\u5730\u5b58\u50a8\u5e93\u4e2d\u7684\u6587\u4ef6\u53d1\u9001\u5e76\u4fdd\u5b58\u5230\u8fdc\u7a0b\u5b58\u50a8\u5e93\u7684\u529f\u80fd\u3002<\/p>\n<h3>\u514b\u9686 (clone)<\/h3>\n<p>\u514b\u9686\u5c31\u50cf\u4e0b\u8f7d\u4e00\u6837\u3002<\/p>\n<h3>\u5408\u5e76<\/h3>\n<p>\u5408\u5e76\u662f\u5c06\u591a\u4e2a\u5206\u652f\u5408\u5e76\u4e3a\u4e00\u4e2a\uff0c\u5e76\u63a5\u8fd1\u6700\u7ec8\u5f62\u6001\u7684\u8fc7\u7a0b\u3002<br \/>\n\u53ef\u4ee5\u5c06\u5206\u652f\u5408\u5e76\u4e3a\u4e00\u4e2a\u7684\u6982\u5ff5\u3002<\/p>\n<h3>\u62c9 (l\u0101)<\/h3>\n<p>\u5728\u672c\u5730\u5b58\u50a8\u5e93\uff08\u5373\u60a8\u7684\u672c\u5730\u73af\u5883\uff09\u4e2d\u7f3a\u5931\u7684\u6587\u4ef6\u6216\u5176\u4ed6\u7528\u6237\u66f4\u65b0\u7684\u6587\u4ef6\u4ec5\u901a\u8fc7\u4ece\u5171\u4eab\u7684\u8fdc\u7a0b\u5b58\u50a8\u5e93\u4e2d\u4e0b\u8f7d\u8fd9\u4e9b\u6587\u4ef6\u7684\u529f\u80fd\u800c\u83b7\u5f97\u7684\u79f0\u4e4b\u4e3a&#8221;\u62c9\u53d6\uff08Pull\uff09&#8221;\u3002<\/p>\n<h3>\u83b7\u53d6<\/h3>\n<p>\u62c9\u53d6\uff08fetch\uff09\u662f\u4ece\u8fdc\u7a0b\u4ed3\u5e93\u83b7\u53d6\u6700\u65b0\u6587\u4ef6\u4fe1\u606f\u7684\u64cd\u4f5c\u3002\u4e0e\u62c9\u53d6\uff08fetch\uff09\u76f8\u6bd4\uff0c\u4e0d\u4f1a\u66f4\u65b0\u672c\u5730\u6587\u4ef6\u3002<\/p>\n<h2>Git\u5f00\u53d1\u7684\u6d41\u7a0b<\/h2>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\u5728GitHub\u4e0a\u521b\u5efa\u5b58\u50a8\u5e93<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\u5728\u81ea\u5df1\u7684\u7535\u8111\u4e0a\u521b\u5efa\u6587\u4ef6\u5939<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\u5c06\u521b\u5efa\u7684\u6587\u4ef6\u5939\u7eb3\u5165Git\u7ba1\u7406\uff0c\u5e76\u4e0a\u4f20\u5230GitHub\u4e0a<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\u4ecemaster\u5206\u652f\u4e0a\u521b\u5efa\u4e00\u4e2a\u65b0\u5206\u652f<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\u5728\u65b0\u5206\u652f\u4e0a\u8fdb\u884c\u5de5\u4f5c<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\u5b8c\u6210\u5de5\u4f5c\u540e\u5c06\u5de5\u4f5c\u5185\u5bb9\u63a8\u9001\u5230\u8fdc\u7a0b\u5b58\u50a8\u5e93<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\u521b\u5efa\u5c06\u65b0\u5206\u652f\u7684\u5185\u5bb9\u5408\u5e76\u5230master\u5206\u652f\u7684Pull Request<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\u5c06Pull Request\u5408\u5e76\u5230master\u5206\u652f\u4e0a<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\u83b7\u53d6master\u5206\u652f\u4e0a\u7684\u5185\u5bb9<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>\u4e4b\u540e\u5faa\u73af\u8fdb\u884c\u6b65\u9aa44\u52309<\/ol>\n<p>\u5982\u679c\u5176\u4ed6\u4eba\u5df2\u7ecf\u521b\u5efa\u4e86\u5b58\u50a8\u5e93\uff0c\u5219\u9700\u8981\u5c06\u8be5\u5b58\u50a8\u5e93\u514b\u9686\u5230\u81ea\u5df1\u7684\u7ec8\u7aef\u4e0a\u8fdb\u884c\u5f00\u53d1\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c1\u81f33\u4e0d\u662f\u5fc5\u9700\u7684\u4efb\u52a1\u3002<\/p>\n<h2>Git\u7684\u64cd\u4f5c\u6d41\u7a0b<\/h2>\n<h3>\u521b\u5efa\u5b58\u50a8\u5e93<\/h3>\n<p>\u5728\u767b\u5f55\u8d26\u6237\u540e\uff0c\u70b9\u51fb\u201c\u521b\u5efa\u4ed3\u5e93\u201d\uff0c\u5c1d\u8bd5\u521b\u5efa\u8fdc\u7a0b\u4ed3\u5e93\uff01<br \/>\n\u203b\u5728GitHub\u4e0a\u521b\u5efa\u7684\u4ed3\u5e93\u88ab\u79f0\u4e3a\u8fdc\u7a0b\u4ed3\u5e93\u3002<\/p>\n<h3>\u5728\u81ea\u5df1\u7684\u7535\u8111\u4e0a\u521b\u5efa\u672c\u5730\u4ed3\u5e93\u3002<\/h3>\n<p>\u8ba9\u6211\u4eec\u5728\u684c\u9762\u4e0a\u521b\u5efa\u4e00\u4e2a\u540d\u4e3agit_test\u7684\u6587\u4ef6\u5939\u5427\uff01\u521b\u5efa\u540e\uff0c\u6253\u5f00VSCode\uff0c\u70b9\u51fb\u5c4f\u5e55\u9876\u90e8\u7684\u7ec8\u7aef\uff0c\u518d\u70b9\u51fb\u65b0\u7ec8\u7aef\u3002<br \/>\n\u8fd9\u6b21\u6211\u4eec\u5c06\u5728\u8fd9\u91cc\u8fdb\u884cgit\u64cd\u4f5c\uff01<\/p>\n<p>\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u521b\u5efa\u672c\u5730\u5b58\u50a8\u5e93\u3002<\/p>\n<pre class=\"post-pre\"><code>$ git init\r\n<\/code><\/pre>\n<p>\u5982\u679c\u663e\u793a\u5982\u4e0b\uff0c\u8868\u793a\u6210\u529f\uff01<\/p>\n<pre class=\"post-pre\"><code>Initialized empty Git repository in ~\r\n<\/code><\/pre>\n<h3>\u5c06\u6587\u4ef6\u6ce8\u518c\u5230\u672c\u5730\u4ee3\u7801\u5e93\u3002<\/h3>\n<p>\u63a5\u4e0b\u6765\uff0c\u5728git_test\u76ee\u5f55\u4e2d\u65b0\u5efatest.txt\u6587\u4ef6\uff0c\u5e76\u968f\u610f\u8fdb\u884c\u7f16\u8f91\u3002<\/p>\n<p>\u5982\u679c\u53ef\u4ee5\u7f16\u8f91\u6587\u4ef6\uff0c\u5c06\u7f16\u8f91\u5185\u5bb9\u901a\u8fc7\u4e0b\u9762\u7684\u547d\u4ee4\u6dfb\u52a0\u5230\u7d22\u5f15\u4e2d\u3002<br \/>\n\u6dfb\u52a0\u5230\u7d22\u5f15\u540e\uff0c\u8be5\u6587\u4ef6\u5c06\u6210\u4e3aGit\u7ba1\u7406\u7684\u5bf9\u8c61\u3002<\/p>\n<pre class=\"post-pre\"><code>$ git add test.txt\r\n<\/code><\/pre>\n<div>\u5982\u679c\u8fd0\u884c &#8220;git add -A .&#8221;\uff0c\u5219\u53ef\u4ee5\u5c06\u6240\u6709\u7684\u6587\u4ef6\u6dfb\u52a0\u5230\u7d22\u5f15\u4e2d\u3002<\/div>\n<p>\u5728\u8fdb\u884c\u7d22\u5f15\u7684\u6dfb\u52a0\u540e\uff0c\u5c06\u66f4\u6539\u5185\u5bb9\u901a\u8fc7\u4e0b\u9762\u7684\u547d\u4ee4\u63d0\u4ea4\u5230\u672c\u5730\u4ed3\u5e93\u3002<\/p>\n<pre class=\"post-pre\"><code>$ git commit -m \u201c\u30b3\u30e1\u30f3\u30c8\u201d\r\n<\/code><\/pre>\n<div>-m\u662f\u6307\u6d88\u606f\u9009\u9879\uff0c\u53ef\u4ee5\u8bb0\u5f55\u5728-m &#8220;&#8221;\u4e2d\u7684\u7f16\u8f91\u5185\u5bb9\u662f\u4ec0\u4e48\u3002<\/div>\n<h3>\u5c06\u66f4\u6539\u63a8\u9001\u5230\u8fdc\u7a0b\u5b58\u50a8\u5e93\u3002<\/h3>\n<p>\u8ba9\u6211\u4eec\u5c06\u53d8\u66f4\u5185\u5bb9\u540c\u6b65\u5230\u8fdc\u7a0b\u5b58\u50a8\u5e93\uff0c\u4ee5\u4fbf\u5728GitHub\u4e0a\u8fdb\u884c\u7248\u672c\u63a7\u5236\uff01<\/p>\n<p>\u9996\u5148\uff0c\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5c06\u672c\u5730\u5b58\u50a8\u5e93\u4e0e\u8fdc\u7a0b\u5b58\u50a8\u5e93\u8fdb\u884c\u5173\u8054\u3002<\/p>\n<pre class=\"post-pre\"><code>$ git remote add origin https:\/\/github.com\/\u30e6\u30fc\u30b6\u30fcID\/\u30ea\u30dd\u30b8\u30c8\u30ea\u540d\r\n<\/code><\/pre>\n<div>URL\u662f\u6307\u5b9a\u5148\u524d\u5728GitHub\u4e0a\u521b\u5efa\u7684\u8fdc\u7a0b\u5b58\u50a8\u5e93\u7684URL\u3002<br \/>\n\u7528\u6237ID\u662f\u6307\u4e2a\u4eba\u8bbe\u7f6e\u7684\u7528\u6237ID\u3002<\/div>\n<div>\u4e0d\u9700\u8981\u6bcf\u6b21\u63a8\u9001\u65f6\u90fd\u6267\u884c\u6b64\u64cd\u4f5c\uff0c\u53ea\u9700\u8981\u5728\u4e00\u5f00\u59cb\u5b8c\u6210\u4e00\u6b21\u4ee5\u5efa\u7acb\u8fde\u63a5\u3002<\/div>\n<p>\u7531\u4e8e\u672c\u5730\u5b58\u50a8\u5e93\u548c\u8fdc\u7a0b\u5b58\u50a8\u5e93\u5df2\u8fde\u63a5\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5c06\u6587\u4ef6\u4e0a\u4f20\u5230\u8fdc\u7a0b\u5b58\u50a8\u5e93\u4e2d\u3002<\/p>\n<pre class=\"post-pre\"><code> $ git push origin master\r\n<\/code><\/pre>\n<div>\u8fd9\u4e2a\u547d\u4ee4\u7528\u4e8e\u5c06\u672c\u5730\u7684\u4e3b\u5206\u652f\u63a8\u9001\u5230\u8fdc\u7a0b\u7684 origin \u4ed3\u5e93\u3002\u901a\u5e38\u7528\u4e8e\u6307\u5411\u9879\u76ee\u7684\u4e3b\u8981\u5f00\u53d1\u5206\u652f\u6216\u7a33\u5b9a\u7248\u672c\u5206\u652f\u7b49\u8868\u793a\u9879\u76ee\u4e3b\u7ebf\u7684\u5206\u652f\u3002<\/div>\n<p>\u5f53\u4f60\u8fd0\u884c\u540e\uff0c\u4f1a\u8df3\u8f6c\u5230GitHub\u9875\u9762\uff0c\u8bf7\u8f93\u5165\u7528\u6237\u540d\u548c\u5bc6\u7801\uff0c\u7136\u540e\u70b9\u51fb\u6388\u6743GitHub\u6309\u94ae\uff0c\u5982\u679c\u4e4b\u524d\u7f16\u8f91\u7684\u5185\u5bb9\u88ab\u53cd\u6620\u51fa\u6765\u4e86\uff0c\u5c31\u8868\u793a\u6210\u529f\uff01<\/p>\n<p>\u8fd9\u6837\uff0c\u4ece\u672c\u5730\u4ed3\u5e93\u4e0a\u4f20\u6587\u4ef6\u5230GitHub\u7684\u6574\u4e2a\u6d41\u7a0b\u5c31\u5b8c\u6210\u4e86\uff01<\/p>\n<h2>\u64cd\u4f5c\u5206\u652f<\/h2>\n<p>\u786e\u8ba4\u5728\u8fdc\u7a0b\u4ed3\u5e93\u6210\u529f\u8bb0\u5f55\u540e\uff0c\u6211\u4eec\u6765\u5728\u672c\u5730\u4ed3\u5e93\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u5206\u652f\u5427\uff01<\/p>\n<h3>\u521b\u5efa\u5206\u652f<\/h3>\n<p>\u4f7f\u7528\u4e0b\u8ff0\u547d\u4ee4\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u5206\u652f\uff0c\u5e76\u540c\u65f6\u5207\u6362\u5230\u8be5\u5206\u652f\u3002<br \/>\n\u4e5f\u5c31\u662f\u8bf4\uff0c\u5728\u65b0\u5206\u652f\u521b\u5efa\u7684\u77ac\u95f4\uff0c\u5de5\u4f5c\u76ee\u5f55\u548cHEAD\u4f1a\u5207\u6362\u5230\u65b0\u5206\u652f\u4e0a\u3002<\/p>\n<pre class=\"post-pre\"><code>$ git switch -c &lt;\u4f5c\u6210\u3057\u305f\u3044\u30d6\u30e9\u30f3\u30c1\u540d&gt;\r\n<\/code><\/pre>\n<h3>\u786e\u8ba4\u672c\u5730\u5206\u652f\u7684\u5185\u5bb9<\/h3>\n<p>\u5982\u679c\u8981\u663e\u793a\u5206\u652f\u5217\u8868\uff0c\u8bf7\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff01\u53e6\u5916\uff0c\u5e26\u6709*\u7684\u5206\u652f\u8868\u793a\u5f53\u524d\u6b63\u5728\u8fdb\u884c\u5de5\u4f5c\u7684\u5206\u652f\u3002<\/p>\n<pre class=\"post-pre\"><code>$ git branch\r\n<\/code><\/pre>\n<h3>\u79fb\u52a8\u5206\u652f<\/h3>\n<p>\u8981\u79fb\u52a8\u64cd\u4f5c\u7684\u5206\u652f\uff0c\u8bf7\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u3002<\/p>\n<pre class=\"post-pre\"><code>$ git checkout &lt;\u79fb\u52d5\u5bfe\u8c61\u306e\u30d6\u30e9\u30f3\u30c1\u540d&gt;\r\n<\/code><\/pre>\n<h3>\u53ea\u9700\u8981\u4e00\u4e2a\u9009\u9879\u5c31\u53ef\u4ee5\u4e86:<\/h3>\n<p>\u5c06\u66f4\u6539\u5185\u5bb9\u540c\u6b65\u5230\u8fdc\u7a0b\u4ed3\u5e93\u4e2d\u3002<\/p>\n<p>\u5728\u8fdc\u7a0b\u4ed3\u5e93\u4e0a\u521b\u5efa\u4e86\u4e00\u4e2a\u540d\u4e3a&lt;\u5206\u652f\u540d&gt;\u7684\u5206\u652f\uff0c\u5e76\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5728GitHub\u4e0a\u5171\u4eab\u7f16\u8f91\u5185\u5bb9\u3002<\/p>\n<pre class=\"post-pre\"><code>git push origin &lt;\u30d6\u30e9\u30f3\u30c1\u540d&gt;\r\n<\/code><\/pre>\n<div>\u8fd9\u4e2a\u547d\u4ee4\u7528\u4e8e\u5c06\u6307\u5b9a\u7684\u672c\u5730\u5206\u652f\uff08&lt;\u5206\u652f\u540d&gt;\uff09\u63a8\u9001\u5230\u8fdc\u7a0b\u7684 origin \u4ed3\u5e93\u3002\u5b83\u901a\u5e38\u7528\u4e8e\u5177\u6709\u65b0\u529f\u80fd\u6216\u5bf9\u5de5\u4f5c\u5206\u652f\u8fdb\u884c\u4fee\u590d\u7684\u5206\u652f\uff0c\u800c\u4e0d\u662f master \u5206\u652f\u3002<\/div>\n<h3>\u786e\u8ba4\u8fdc\u7a0b\u5b58\u50a8\u5e93<\/h3>\n<p>\u9996\u5148\uff0c\u8ba9\u6211\u4eec\u5728\u6d4f\u89c8\u5668\u4e2d\u6253\u5f00GitHub\u3002<br \/>\n\u7136\u540e\uff0c\u8bf7\u6253\u5f00\u5b58\u50a8\u5e93\u3002<br \/>\n\u4e00\u65e6\u6253\u5f00\uff0c\u70b9\u51fb\u4e3b\u5206\u652f\uff0c\u5373\u53ef\u51fa\u73b0\u4e0b\u62c9\u83dc\u5355\uff0c\u60a8\u53ef\u4ee5\u9009\u62e9\u5206\u652f\u3002<\/p>\n<h3>&#8220;Pull Request&#8221; \u662f\u4ec0\u4e48\u610f\u601d?<\/h3>\n<p>\u5728GitHub\u4e0a\uff0c\u901a\u8fc7`git push origin &lt;\u5206\u652f\u540d&gt;`\u5c06\u5206\u652f\u5185\u5bb9\u63a8\u9001\u5230\u8fdc\u7a0b\u4ed3\u5e93\u7684master\u5206\u652f\uff0c\u7136\u540e\u521b\u5efa\u4e00\u4e2a\u79f0\u4e3a&#8221;Pull Request&#8221;\u7684\u4e1c\u897f\uff0c\u5c06\u5206\u652f\u7684\u5de5\u4f5c\u5185\u5bb9\u53cd\u6620\u5230master\u5206\u652f\u4e0a\u3002<br \/>\n\u5411\u5bf9\u65b9\u8bf4\u201c\u6211\u60f3\u5c06\u5206\u652f\u7684\u5de5\u4f5c\u5185\u5bb9\u53cd\u6620\u5230master\u5206\u652f\u4e0a\uff0c\u8bf7\u95ee\u53ef\u4ee5\u5417\uff1f\u201d<\/p>\n<h3>\u521b\u5efa\u62c9\u53d6\u8bf7\u6c42<\/h3>\n<p>\u9996\u5148\uff0c\u8bf7\u6253\u5f00GitHub\u5e76\u6253\u5f00\u4ed3\u5e93\u3002<br \/>\n\u7136\u540e\uff0c\u8bf7\u70b9\u51fb\u83dc\u5355\u680f\u4e2d\u7684Pull requests\u3002<\/p>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d2e5337434c4406c53f80\/80-0.png\" alt=\"b821c6b2-8e99-0fe1-c987-bbc4d963520a.png\" \/><\/div>\n<p>\u70b9\u51fb\u201c\u521b\u5efa\u65b0\u7684\u62c9\u53d6\u8bf7\u6c42\u201d\u3002<\/p>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d2e5337434c4406c53f80\/82-0.png\" alt=\"59bbe34f-bf96-e4b1-05ce-7fe3a2ec00fb.png\" \/><\/div>\n<p>\u5f53\u60a8\u786e\u8ba4\u4e0b\u56fe\u4e2d\u7ea2\u6846\u6240\u793a\u7684\u90e8\u5206\u662f\u60a8\u60f3\u521b\u5efa\u62c9\u53d6\u8bf7\u6c42\u7684\u5206\u652f\u65f6\uff0c\u8bf7\u70b9\u51fb\u201c\u521b\u5efa\u62c9\u53d6\u8bf7\u6c42\u201d\u3002<\/p>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d2e5337434c4406c53f80\/84-0.png\" alt=\"19e792df-7ba2-573e-2469-4c90806cfbb8.png\" \/><\/div>\n<p>\u7531\u4e8e\u5c06\u8f6c\u5230\u4e00\u4e2a\u53ef\u4ee5\u8f93\u5165\u6807\u9898\u548c\u8bc4\u8bba\u7684\u9875\u9762\uff0c\u56e0\u6b64\u5176\u4ed6\u5f00\u53d1\u4eba\u5458\u548c\u7ecf\u7406\u7b49\u4e5f\u5c06\u770b\u5230\u8fd9\u4e2a\u6807\u9898\u548c\u8bc4\u8bba\uff0c\u6240\u4ee5\u8bf7\u5c3d\u91cf\u5199\u5f97\u6e05\u695a\u6613\u61c2\uff01\u5b8c\u6210\u8f93\u5165\u540e\uff0c\u70b9\u51fb\u201c\u521b\u5efa\u62c9\u53d6\u8bf7\u6c42\u201d\u5373\u53ef\u5b8c\u6210\u62c9\u53d6\u8bf7\u6c42\u7684\u521b\u5efa\u3002<\/p>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d2e5337434c4406c53f80\/86-0.png\" alt=\"2dd1fde5-3a95-0c63-dc77-c30a968db885.png\" \/><\/div>\n<h3>\u5408\u5e76\u62c9\u53d6\u8bf7\u6c42<\/h3>\n<p>\u521b\u5efa\u62c9\u53d6\u8bf7\u6c42\u540e\uff0c\u4f1a\u8bf7\u7ecf\u7406\u6216\u5176\u4ed6\u76f8\u5173\u4eba\u5458\u67e5\u770b\u5b9e\u65bd\u5185\u5bb9\u5e76\u5408\u5e76\u3002<\/p>\n<p>\u9996\u5148\uff0c\u70b9\u51fb\u83dc\u5355\u680f\u4e2d\u7684&#8221;Pull requests&#8221;\uff0c\u60a8\u53ef\u4ee5\u67e5\u770b\u5f53\u524d\u7684\u6240\u6709\u62c9\u53d6\u8bf7\u6c42\u3002<br \/>\n\u8bf7\u70b9\u51fb\u5217\u8868\u4e2d\u6211\u4eec\u6240\u521b\u5efa\u5e76\u5e0c\u671b\u5408\u5e76\u7684\u62c9\u53d6\u8bf7\u6c42\u3002<\/p>\n<p>\u70b9\u51fb\u5176\u4e2d\u7684&#8221;Merge pull request&#8221;\u540e\uff0c\u4f1a\u51fa\u73b0\u4e00\u4e2a\u540d\u4e3a&#8221;Confirm merge&#8221;\u7684\u6309\u94ae\uff0c\u70b9\u51fb\u8be5\u6309\u94ae\u5c06\u4f1a\u5c06\u8fdc\u7a0b\u5206\u652f\u5408\u5e76\u5230master\u5206\u652f\u4e0a\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Git \u662f\u4e00\u4e2a\u7248\u672c\u63a7\u5236\u7cfb\u7edf\u3002 \u8fd9\u662f\u4e00\u4e2a\u5206\u6563\u5f0f\u7248\u672c\u63a7\u5236\u7cfb\u7edf\u3002 \u88ab\u79f0\u4e3a\u5206\u6563\u5f0f\u7248\u672c\u63a7\u5236\u7cfb\u7edf\uff0c\u662f\u56e0\u4e3a\u5177\u5907\u4ee5\u4e0b\u7279\u5f81\u3002 \u53e4 [&hellip;]<\/p>\n","protected":false},"author":8,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-37376","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Git\u548cGitHub\u6982\u8ff0 - Blog - Silicon Cloud<\/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.silicloud.com\/zh\/blog\/git\u548cgithub\u6982\u8ff0\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Git\u548cGitHub\u6982\u8ff0\" \/>\n<meta property=\"og:description\" content=\"Git \u662f\u4e00\u4e2a\u7248\u672c\u63a7\u5236\u7cfb\u7edf\u3002 \u8fd9\u662f\u4e00\u4e2a\u5206\u6563\u5f0f\u7248\u672c\u63a7\u5236\u7cfb\u7edf\u3002 \u88ab\u79f0\u4e3a\u5206\u6563\u5f0f\u7248\u672c\u63a7\u5236\u7cfb\u7edf\uff0c\u662f\u56e0\u4e3a\u5177\u5907\u4ee5\u4e0b\u7279\u5f81\u3002 \u53e4 [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/git\u548cgithub\u6982\u8ff0\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2023-10-28T15:10:11+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-30T06:21:22+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d2e5337434c4406c53f80\/80-0.png\" \/>\n<meta name=\"author\" content=\"\u96c5, \u609f\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u96c5, \u609f\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/git%e5%92%8cgithub%e6%a6%82%e8%bf%b0\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/git%e5%92%8cgithub%e6%a6%82%e8%bf%b0\/\",\"name\":\"Git\u548cGitHub\u6982\u8ff0 - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2023-10-28T15:10:11+00:00\",\"dateModified\":\"2024-04-30T06:21:22+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/f044a4b7fa4ee2701702942002419ca6\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/git%e5%92%8cgithub%e6%a6%82%e8%bf%b0\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/git%e5%92%8cgithub%e6%a6%82%e8%bf%b0\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/git%e5%92%8cgithub%e6%a6%82%e8%bf%b0\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/zh\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Git\u548cGitHub\u6982\u8ff0\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/f044a4b7fa4ee2701702942002419ca6\",\"name\":\"\u96c5, \u609f\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/e71a913e914f1aad1efc391f92084294bac54bc782acd289638580134cf667a6?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/e71a913e914f1aad1efc391f92084294bac54bc782acd289638580134cf667a6?s=96&d=mm&r=g\",\"caption\":\"\u96c5, \u609f\"},\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/author\/yawu\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/git%e5%92%8cgithub%e6%a6%82%e8%bf%b0\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Git\u548cGitHub\u6982\u8ff0 - Blog - Silicon Cloud","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.silicloud.com\/zh\/blog\/git\u548cgithub\u6982\u8ff0\/","og_locale":"zh_CN","og_type":"article","og_title":"Git\u548cGitHub\u6982\u8ff0","og_description":"Git \u662f\u4e00\u4e2a\u7248\u672c\u63a7\u5236\u7cfb\u7edf\u3002 \u8fd9\u662f\u4e00\u4e2a\u5206\u6563\u5f0f\u7248\u672c\u63a7\u5236\u7cfb\u7edf\u3002 \u88ab\u79f0\u4e3a\u5206\u6563\u5f0f\u7248\u672c\u63a7\u5236\u7cfb\u7edf\uff0c\u662f\u56e0\u4e3a\u5177\u5907\u4ee5\u4e0b\u7279\u5f81\u3002 \u53e4 [&hellip;]","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/git\u548cgithub\u6982\u8ff0\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2023-10-28T15:10:11+00:00","article_modified_time":"2024-04-30T06:21:22+00:00","og_image":[{"url":"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d2e5337434c4406c53f80\/80-0.png"}],"author":"\u96c5, \u609f","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u96c5, \u609f","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/git%e5%92%8cgithub%e6%a6%82%e8%bf%b0\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/git%e5%92%8cgithub%e6%a6%82%e8%bf%b0\/","name":"Git\u548cGitHub\u6982\u8ff0 - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2023-10-28T15:10:11+00:00","dateModified":"2024-04-30T06:21:22+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/f044a4b7fa4ee2701702942002419ca6"},"breadcrumb":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/git%e5%92%8cgithub%e6%a6%82%e8%bf%b0\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/git%e5%92%8cgithub%e6%a6%82%e8%bf%b0\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/zh\/blog\/git%e5%92%8cgithub%e6%a6%82%e8%bf%b0\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/zh\/blog\/"},{"@type":"ListItem","position":2,"name":"Git\u548cGitHub\u6982\u8ff0"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website","url":"https:\/\/www.silicloud.com\/zh\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/f044a4b7fa4ee2701702942002419ca6","name":"\u96c5, \u609f","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/e71a913e914f1aad1efc391f92084294bac54bc782acd289638580134cf667a6?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/e71a913e914f1aad1efc391f92084294bac54bc782acd289638580134cf667a6?s=96&d=mm&r=g","caption":"\u96c5, \u609f"},"url":"https:\/\/www.silicloud.com\/zh\/blog\/author\/yawu\/"},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/git%e5%92%8cgithub%e6%a6%82%e8%bf%b0\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/37376","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/comments?post=37376"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/37376\/revisions"}],"predecessor-version":[{"id":92426,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/37376\/revisions\/92426"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=37376"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=37376"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=37376"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}