{"id":19183,"date":"2024-11-19T15:32:57","date_gmt":"2024-11-19T07:32:57","guid":{"rendered":"https:\/\/fwq.ai\/blog\/19183\/"},"modified":"2024-11-19T15:32:57","modified_gmt":"2024-11-19T07:32:57","slug":"%e6%80%8e%e4%b9%88%e6%9b%b4%e6%94%b9git%e4%bb%93%e5%ba%93%e5%9c%b0%e5%9d%80","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/19183\/","title":{"rendered":"\u600e\u4e48\u66f4\u6539git\u4ed3\u5e93\u5730\u5740"},"content":{"rendered":"<p>\u5728\u8fdb\u884c\u5f00\u53d1\u3001\u7ba1\u7406\u4ee3\u7801\u7684\u5de5\u4f5c\u4e2d\uff0c\u7ecf\u5e38\u9700\u8981\u4f7f\u7528\u5230git\u8fdb\u884c\u7248\u672c\u63a7\u5236\u3002\u6709\u65f6\u5019\uff0c\u4e3a\u4e86\u66f4\u597d\u5730\u7ef4\u62a4\u4ee3\u7801\uff0c\u6211\u4eec\u9700\u8981\u66f4\u6539git\u4ed3\u5e93\u7684\u5730\u5740\u3002\u672c\u6587\u5c06\u4ecb\u7ecd\u5982\u4f55\u66f4\u6539git\u4ed3\u5e93\u5730\u5740\u3002<\/p>\n<p>\u4e00\u3001\u4f7f\u7528\u547d\u4ee4\u884c\u66f4\u6539<\/p>\n<ol>\n<li>\n<p>\u4ece\u8fdc\u7a0b\u4ed3\u5e93clone\u4e00\u4e2a\u672c\u5730\u4ed3\u5e93<\/p>\n<pre>git clone [remote-url]<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236  <\/li>\n<li>\n<p>\u8fdb\u5165\u672c\u5730\u4ed3\u5e93\u76ee\u5f55<\/p>\n<pre>cd &lt;local-repo&gt;<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236  <\/li>\n<li>\n<p>\u663e\u793a\u5f53\u524dGit\u4ed3\u5e93\u7684\u8fdc\u7a0b\u4ed3\u5e93\u5730\u5740<\/p>\n<pre>git remote -v<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236    \u767b\u5f55\u540e\u590d\u5236  <\/li>\n<li>\n<p>\u66f4\u6539Git\u4ed3\u5e93\u7684\u8fdc\u7a0b\u4ed3\u5e93\u5730\u5740<\/p>\n<pre>git remote set-url origin [new-remote-url]<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236  <\/li>\n<li>\n<p>\u9a8c\u8bc1\u662f\u5426\u66f4\u6539\u6210\u529f\uff0c\u663e\u793aGit\u4ed3\u5e93\u7684\u8fdc\u7a0b\u4ed3\u5e93\u5730\u5740<\/p>\n<pre>git remote -v<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236    \u767b\u5f55\u540e\u590d\u5236  <\/li>\n<li>\n<p>\u5c06\u66f4\u6539\u540e\u7684\u4ee3\u7801\u63d0\u4ea4\u5230\u65b0\u7684\u8fdc\u7a0b\u4ed3\u5e93\u5730\u5740<\/p>\n<pre>git push origin master<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236  <\/li>\n<\/ol>\n<p>\u4e8c\u3001\u4f7f\u7528\u56fe\u5f62\u5316\u754c\u9762\u66f4\u6539<\/p>\n<ol>\n<li>\u6253\u5f00Git\u56fe\u5f62\u754c\u9762<\/li>\n<li>\u63a5\u4e0b\u6765\u7684\u64cd\u4f5c\u5c31\u4e0e\u547d\u4ee4\u884c\u64cd\u4f5c\u7c7b\u4f3c\uff0c\u627e\u5230Git\u4ed3\u5e93\u7684\u8bbe\u7f6e\u9009\u9879\uff0c\u66f4\u6539\u8fdc\u7a0b\u4ed3\u5e93\u5730\u5740\u5373\u53ef\u3002<\/li>\n<\/ol>\n<p>\u4e09\u3001\u4f7f\u7528GitLab\u66f4\u6539<\/p>\n<p>\u5982\u679c\u6211\u4eec\u4f7f\u7528\u7684\u662fGitLab\uff0c\u6211\u4eec\u4e5f\u53ef\u4ee5\u5728GitLab\u4e2d\u66f4\u6539Git\u4ed3\u5e93\u5730\u5740\u3002<\/p>\n<ol>\n<li>\u767b\u5f55GitLab\uff0c\u627e\u5230\u9700\u8981\u66f4\u6539\u7684\u9879\u76ee<\/li>\n<li>\u8fdb\u5165\u9879\u76ee\u7684\u9875\u9762\uff0c\u70b9\u51fb\u5de6\u8fb9\u7684\u201c\u8bbe\u7f6e\u201d\u9009\u9879<\/li>\n<li>\u8fdb\u5165\u201c\u4ed3\u5e93\u201d\u9009\u9879\u5361<\/li>\n<li>\u66f4\u6539\u8fdc\u7a0b\u4ed3\u5e93\u5730\u5740\u7684URL\uff0c\u70b9\u51fb\u201c\u4fdd\u5b58\u201d<\/li>\n<\/ol>\n<p>\u603b\u7ed3<\/p>\n<p>\u65e0\u8bba\u662f\u4f7f\u7528\u547d\u4ee4\u884c\u8fd8\u662f\u56fe\u5f62\u5316\u754c\u9762\uff0c\u8fd8\u662f\u5728GitLab\u4e2d\u4fee\u6539\uff0c\u64cd\u4f5c\u4e0a\u90fd\u662f\u6bd4\u8f83\u7b80\u5355\u7684\u3002\u4f46\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u5982\u679c\u4f60\u66f4\u6539\u4e86Git\u4ed3\u5e93\u5730\u5740\uff0c\u5728\u540e\u7eed\u7684\u64cd\u4f5c\u4e2d\u9700\u8981\u4f7f\u7528\u65b0\u7684\u5730\u5740\u624d\u80fd\u5b8c\u6210\u7248\u672c\u63a7\u5236\u3002\u540c\u65f6\uff0c\u5982\u679c\u4f7f\u7528\u7684\u662f\u5171\u4eab\u4ed3\u5e93\uff0c\u9700\u8981\u786e\u4fdd\u5176\u4ed6\u5f00\u53d1\u8005\u77e5\u9053\u4e86\u65b0\u7684\u4ed3\u5e93\u5730\u5740\uff0c\u4ee5\u907f\u514d\u5f00\u53d1\u8005\u65e0\u6cd5\u901a\u8fc7\u65e7\u5730\u5740\u62c9\u53d6\u4ee3\u7801\u3002<\/p>\n<p>\u66f4\u6539Git\u4ed3\u5e93\u5730\u5740\u662f\u4e00\u4ef6\u975e\u5e38\u5e38\u89c1\u7684\u64cd\u4f5c\uff0c\u7406\u89e3\u8be5\u65b9\u6cd5\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u5728\u7ef4\u62a4\u4ee3\u7801\u65f6\u66f4\u52a0\u5f97\u5fc3\u5e94\u624b\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u600e\u4e48\u66f4\u6539git\u4ed3\u5e93\u5730\u5740\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>\u5728\u8fdb\u884c\u5f00\u53d1\u3001\u7ba1\u7406\u4ee3\u7801\u7684\u5de5\u4f5c\u4e2d\uff0c\u7ecf\u5e38\u9700\u8981\u4f7f\u7528\u5230git\u8fdb\u884c\u7248\u672c\u63a7\u5236\u3002\u6709\u65f6\u5019\uff0c\u4e3a\u4e86\u66f4\u597d\u5730\u7ef4\u62a4\u4ee3\u7801\uff0c\u6211\u4eec\u9700\u8981\u66f4\u6539git\u4ed3\u5e93\u7684\u5730\u5740\u3002\u672c\u6587\u5c06\u4ecb\u7ecd\u5982\u4f55\u66f4\u6539git\u4ed3\u5e93\u5730\u5740\u3002 \u4e00\u3001\u4f7f\u7528\u547d\u4ee4\u884c\u66f4\u6539 \u4ece\u8fdc\u7a0b\u4ed3\u5e93clone\u4e00\u4e2a\u672c\u5730\u4ed3\u5e93 git clone [remote-url] \u767b\u5f55\u540e\u590d\u5236 \u8fdb\u5165\u672c\u5730\u4ed3\u5e93\u76ee\u5f55 cd &lt;local-repo&gt; \u767b\u5f55\u540e\u590d\u5236 \u663e\u793a\u5f53\u524dGit\u4ed3\u5e93\u7684\u8fdc\u7a0b\u4ed3\u5e93\u5730\u5740 git remote -v \u767b\u5f55\u540e\u590d\u5236 \u767b\u5f55\u540e\u590d\u5236 \u66f4\u6539Git\u4ed3\u5e93\u7684\u8fdc\u7a0b\u4ed3\u5e93\u5730\u5740 git remote set-url origin [new-remote-url] \u767b\u5f55\u540e\u590d\u5236 \u9a8c\u8bc1\u662f\u5426\u66f4\u6539\u6210\u529f\uff0c\u663e\u793aGit\u4ed3\u5e93\u7684\u8fdc\u7a0b\u4ed3\u5e93\u5730\u5740 git remote -v \u767b\u5f55\u540e\u590d\u5236 \u767b\u5f55\u540e\u590d\u5236 \u5c06\u66f4\u6539\u540e\u7684\u4ee3\u7801\u63d0\u4ea4\u5230\u65b0\u7684\u8fdc\u7a0b\u4ed3\u5e93\u5730\u5740 git push origin master \u767b\u5f55\u540e\u590d\u5236 \u4e8c\u3001\u4f7f\u7528\u56fe\u5f62\u5316\u754c\u9762\u66f4\u6539 \u6253\u5f00Git\u56fe\u5f62\u754c\u9762 \u63a5\u4e0b\u6765\u7684\u64cd\u4f5c\u5c31\u4e0e\u547d\u4ee4\u884c\u64cd\u4f5c\u7c7b\u4f3c\uff0c\u627e\u5230Git\u4ed3\u5e93\u7684\u8bbe\u7f6e\u9009\u9879\uff0c\u66f4\u6539\u8fdc\u7a0b\u4ed3\u5e93\u5730\u5740\u5373\u53ef\u3002 \u4e09\u3001\u4f7f\u7528GitLab\u66f4\u6539 \u5982\u679c\u6211\u4eec\u4f7f\u7528\u7684\u662fGitLab\uff0c\u6211\u4eec\u4e5f\u53ef\u4ee5\u5728GitLab\u4e2d\u66f4\u6539Git\u4ed3\u5e93\u5730\u5740\u3002 \u767b\u5f55GitLab\uff0c\u627e\u5230\u9700\u8981\u66f4\u6539\u7684\u9879\u76ee \u8fdb\u5165\u9879\u76ee\u7684\u9875\u9762\uff0c\u70b9\u51fb\u5de6\u8fb9\u7684\u201c\u8bbe\u7f6e\u201d\u9009\u9879 \u8fdb\u5165\u201c\u4ed3\u5e93\u201d\u9009\u9879\u5361 \u66f4\u6539\u8fdc\u7a0b\u4ed3\u5e93\u5730\u5740\u7684URL\uff0c\u70b9\u51fb\u201c\u4fdd\u5b58\u201d \u603b\u7ed3 \u65e0\u8bba\u662f\u4f7f\u7528\u547d\u4ee4\u884c\u8fd8\u662f\u56fe\u5f62\u5316\u754c\u9762\uff0c\u8fd8\u662f\u5728GitLab\u4e2d\u4fee\u6539\uff0c\u64cd\u4f5c\u4e0a\u90fd\u662f\u6bd4\u8f83\u7b80\u5355\u7684\u3002\u4f46\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u5982\u679c\u4f60\u66f4\u6539\u4e86Git\u4ed3\u5e93\u5730\u5740\uff0c\u5728\u540e\u7eed\u7684\u64cd\u4f5c\u4e2d\u9700\u8981\u4f7f\u7528\u65b0\u7684\u5730\u5740\u624d\u80fd\u5b8c\u6210\u7248\u672c\u63a7\u5236\u3002\u540c\u65f6\uff0c\u5982\u679c\u4f7f\u7528\u7684\u662f\u5171\u4eab\u4ed3\u5e93\uff0c\u9700\u8981\u786e\u4fdd\u5176\u4ed6\u5f00\u53d1\u8005\u77e5\u9053\u4e86\u65b0\u7684\u4ed3\u5e93\u5730\u5740\uff0c\u4ee5\u907f\u514d\u5f00\u53d1\u8005\u65e0\u6cd5\u901a\u8fc7\u65e7\u5730\u5740\u62c9\u53d6\u4ee3\u7801\u3002 \u66f4\u6539Git\u4ed3\u5e93\u5730\u5740\u662f\u4e00\u4ef6\u975e\u5e38\u5e38\u89c1\u7684\u64cd\u4f5c\uff0c\u7406\u89e3\u8be5\u65b9\u6cd5\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u5728\u7ef4\u62a4\u4ee3\u7801\u65f6\u66f4\u52a0\u5f97\u5fc3\u5e94\u624b\u3002 \u4ee5\u4e0a\u5c31\u662f\u600e\u4e48\u66f4\u6539git\u4ed3\u5e93\u5730\u5740\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/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-19183","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/19183","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=19183"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/19183\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=19183"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=19183"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=19183"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}