{"id":255,"date":"2026-03-08T14:03:09","date_gmt":"2026-03-08T14:03:09","guid":{"rendered":"https:\/\/hyc.eshachem.com\/program\/?p=255"},"modified":"2026-04-14T12:57:12","modified_gmt":"2026-04-14T12:57:12","slug":"git-%e5%bc%b7%e5%88%b6%e5%90%88%e4%bd%b5","status":"publish","type":"post","link":"https:\/\/hyc.eshachem.com\/program\/git-%e5%bc%b7%e5%88%b6%e5%90%88%e4%bd%b5\/","title":{"rendered":"GIT: \u672c\u5730\u5f37\u5236\u5408\u4f75\u5230upstream"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u592a\u4e45\u6c92\u6709\u62c9\u6771\u897f\u4e0b\u4f86\u6642\uff0c\u5728gitlab\u8981merge Request\u6642\u6703\u9047\u5230\u5408\u4f75\u885d\u7a81\uff0c\u4f46\u5982\u679c\u4f60\u78ba\u5b9a\u4f60\u7684\u672c\u5730\u7248\u672c\u5c31\u662f\u6700\u65b0\u7684\u7248\u672c\uff0c\u8ddf\u5718\u968a\u6210\u54e1\u5546\u8a0e\u904e\u5f8c\u53ef\u4ee5\u76f4\u63a5\u57f7\u884c\u5f37\u5236\u5408\u4f75:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728\u7d42\u7aef\u6a5f\u4e2dcd\u9032\u5165\u5c08\u6848\u8cc7\u6599\u593e\u7136\u5f8c\u8f38\u5165 <code>git remote -v<\/code> \u53ef\u4ee5\u6aa2\u8996\u7576\u524d\u5404\u500b\u5206\u652f\u7684\u6307\u5411\uff0c\u5728\u6a19\u6e96\u7684 Git \u5354\u4f5c\u6d41\u7a0b\u4e2d\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li class=\"\"><strong><code>origin<\/code><\/strong>\uff1a\u61c9\u8a72\u6307\u5411\u4f60\u7684 <strong>\u500b\u4eba Fork<\/strong>\uff08<code>HarryChen1029\/cell-front-end<\/code>\uff09\u3002<\/li>\n\n\n\n<li class=\"\"><strong><code>upstream<\/code><\/strong>\uff1a\u61c9\u8a72\u6307\u5411 <strong>\u539f\u59cb\u5c08\u6848\u4e3b\u5009\u5eab<\/strong>\uff08\u901a\u5e38\u662f <code>birc-web\/cell-front-end<\/code> \u6216\u7d44\u7e54\u5e33\u865f\uff09\u3002<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u5982\u679c\u6709\u6307\u5411\u932f\u8aa4\uff0c\u53ef\u4ee5\u5148\u522a\u9664\u932f\u8aa4\u7684 upstream<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>git remote remove {Wrong Branch}<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u518d\u63db\u6210\u771f\u6b63\u7684\u5c08\u6848\u4e3b\u8def\u5f91<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>git remote add upstream https:\/\/gitlab.ntubimdbirc.tw\/{Project Name}.git<\/code><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"%e7%ac%ac%e4%b8%80%e6%ad%a5%ef%bc%9a%e6%b8%85%e7%90%86%e4%b8%a6%e7%a2%ba%e8%aa%8d%e6%9c%ac%e5%9c%b0%e7%8b%80%e6%85%8b\">\u7b2c\u4e00\u6b65\uff1a\u6e05\u7406\u4e26\u78ba\u8a8d\u672c\u5730\u72c0\u614b<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u5148\u78ba\u4fdd\u4f60\u7684\u672c\u5730 <code>dev<\/code> \u5206\u652f\u662f\u6700\u4e7e\u6de8\u3001\u6700\u65b0\u7684\u72c0\u614b\u3002<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-comment\"># \u78ba\u4fdd\u5728 dev \u5206\u652f<\/span>\ngit checkout dev\n\n<span class=\"hljs-comment\"># (\u9078\u505a) \u5982\u679c\u4f60\u60f3\u653e\u68c4\u6240\u6709\u672c\u5730\u672a\u5b58\u6a94\u7684\u96dc\u4e82\u6539\u52d5 (.env \u7b49)<\/span>\ngit restore .\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h3 class=\"wp-block-heading\" id=\"%e7%ac%ac%e4%ba%8c%e6%ad%a5%ef%bc%9a%e5%b0%87%e4%b8%bb%e5%80%89%e5%ba%ab-upstream-%e7%9a%84%e6%9b%b4%e6%96%b0%e6%8a%93%e4%b8%8b%e4%be%86%e8%a7%a3%e6%b1%ba\">\u7b2c\u4e8c\u6b65\uff1a\u5c07\u4e3b\u5009\u5eab (Upstream) \u7684\u66f4\u65b0\u6293\u4e0b\u4f86\u89e3\u6c7a<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u5373\u4f7f\u8981\u5f37\u5236\u5408\u4f75\uff0c\u6700\u597d\u7684\u505a\u6cd5\u9084\u662f\u5148\u8b93\u672c\u5730\u300c\u541e\u6389\u300d\u9060\u7aef\u7684\u66f4\u65b0\uff0c\u9019\u6a23\u53ef\u4ee5\u907f\u514d Pipeline \u57f7\u884c\u5931\u6557\u3002<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-comment\"># \u6293\u53d6\u4e3b\u5009\u5eab\u6700\u65b0\u52d5\u614b<\/span>\ngit fetch upstream\n\n<span class=\"hljs-comment\"># \u5f37\u884c\u8b93\u672c\u5730 dev \u5438\u6536 upstream\/dev \u7684\u5167\u5bb9 (\u89e3\u6c7a\u885d\u7a81)<\/span>\ngit merge upstream\/dev\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<ul class=\"wp-block-list\">\n<li class=\"\"><strong>\u82e5\u6709\u885d\u7a81<\/strong>\uff1a\u6253\u958b\u7de8\u8f2f\u5668\u5b58\u6a94\u4f60\u8981\u7684\u7a0b\u5f0f\u78bc\uff0c\u7136\u5f8c\u57f7\u884c\uff1aBash<code>git add . git commit -m \"chore: \u89e3\u6c7a\u885d\u7a81\u4e26\u6e96\u5099\u5f37\u5236\u66f4\u65b0\"<\/code><\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"%e7%ac%ac%e4%b8%89%e6%ad%a5%ef%bc%9a%e5%bc%b7%e5%88%b6%e6%8e%a8%e9%80%81%e5%88%b0%e4%b8%bb%e5%80%89%e5%ba%ab-upstream\">\u7b2c\u4e09\u6b65\uff1a\u5f37\u5236\u63a8\u9001\u5230\u4e3b\u5009\u5eab (Upstream)<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u9019\u662f\u6700\u95dc\u9375\u7684\u4e00\u6b65\uff0c\u76f4\u63a5\u7528\u4f60\u73fe\u5728\u9019\u53f0\u96fb\u8166\u7684\u5167\u5bb9\u300c\u6d17\u6389\u300d\u9060\u7aef <code>dev<\/code>\u3002<\/p>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">git push upstream dev --force<\/code><\/span><\/pre>\n\n\n<p class=\"wp-block-paragraph\">\u53ef\u4ee5\u57f7\u884c\u4ee5\u4e0b\u7a0b\u5f0f\u78bc\u9032\u884c\u78ba\u8a8d:<\/p>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">git fetch upstream\ngit diff development upstream\/development<\/code><\/span><\/pre>\n\n\n<p class=\"wp-block-paragraph\">\u82e5<code>git diff<\/code>\u2026 \u6c92\u6709\u986f\u793a\u6771\u897f\uff0c\u90a3\u5c31\u4ee3\u8868\u5408\u4f75\u6210\u529f\u4e86!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u592a\u4e45\u6c92\u6709\u62c9\u6771\u897f\u4e0b\u4f86\u6642\uff0c\u5728gitlab\u8981merge Request\u6642\u6703\u9047\u5230\u5408\u4f75\u885d\u7a81\uff0c\u4f46\u5982\u679c\u4f60\u78ba\u5b9a\u4f60\u7684\u672c\u5730\u7248\u672c\u5c31\u662f\u6700\u65b0\u7684\u7248\u672c\uff0c\u8ddf\u5718\u968a\u6210\u54e1\u5546\u8a0e\u904e\u5f8c\u53ef\u4ee5\u76f4\u63a5\u57f7\u884c\u5f37\u5236\u5408\u4f75: \u5728\u7d42\u7aef\u6a5f\u4e2dcd\u9032\u5165\u5c08\u6848\u8cc7\u6599\u593e\u7136\u5f8c\u8f38\u5165 git remote -v \u53ef\u4ee5\u6aa2\u8996\u7576\u524d\u5404\u500b\u5206\u652f\u7684\u6307\u5411\uff0c\u5728\u6a19\u6e96\u7684 Git \u5354\u4f5c\u6d41\u7a0b\u4e2d\uff1a \u5982\u679c\u6709\u6307\u5411\u932f\u8aa4\uff0c\u53ef\u4ee5\u5148\u522a\u9664\u932f\u8aa4\u7684 upstream git remote remove {Wrong Branch} \u518d\u63db\u6210\u771f\u6b63\u7684\u5c08\u6848\u4e3b\u8def\u5f91 git remote add upstream https:\/\/gitlab.ntubimdbirc.tw\/{Project Name}.git \u7b2c\u4e00\u6b65\uff1a\u6e05\u7406\u4e26\u78ba\u8a8d\u672c\u5730\u72c0\u614b \u5148\u78ba\u4fdd\u4f60\u7684\u672c\u5730 dev \u5206\u652f\u662f\u6700\u4e7e\u6de8\u3001\u6700\u65b0\u7684\u72c0\u614b\u3002 \u7b2c\u4e8c\u6b65\uff1a\u5c07\u4e3b\u5009\u5eab (Upstream) \u7684\u66f4\u65b0\u6293\u4e0b\u4f86\u89e3\u6c7a \u5373\u4f7f\u8981\u5f37\u5236\u5408\u4f75\uff0c\u6700\u597d\u7684\u505a\u6cd5\u9084\u662f\u5148\u8b93\u672c\u5730\u300c\u541e\u6389\u300d\u9060\u7aef\u7684\u66f4\u65b0\uff0c\u9019\u6a23\u53ef\u4ee5\u907f\u514d Pipeline \u57f7\u884c\u5931\u6557\u3002 \u7b2c\u4e09\u6b65\uff1a\u5f37\u5236\u63a8\u9001\u5230\u4e3b\u5009\u5eab (Upstream) \u9019\u662f\u6700\u95dc\u9375\u7684\u4e00\u6b65\uff0c\u76f4\u63a5\u7528\u4f60\u73fe\u5728\u9019\u53f0\u96fb\u8166\u7684\u5167\u5bb9\u300c\u6d17\u6389\u300d\u9060\u7aef dev\u3002 \u53ef\u4ee5\u57f7\u884c\u4ee5\u4e0b\u7a0b\u5f0f\u78bc\u9032\u884c\u78ba\u8a8d: \u82e5git diff\u2026 \u6c92\u6709\u986f\u793a\u6771\u897f\uff0c\u90a3\u5c31\u4ee3\u8868\u5408\u4f75\u6210\u529f\u4e86!<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"footnotes":""},"categories":[40],"tags":[],"class_list":["post-255","post","type-post","status-publish","format-standard","hentry","category-git"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.10 - aioseo.com -->\n\t<meta name=\"description\" content=\"\u592a\u4e45\u6c92\u6709\u62c9\u6771\u897f\u4e0b\u4f86\u6642\uff0c\u5728gitlab\u8981merge Request\u6642\u6703\u9047\u5230\u5408\u4f75\u885d\u7a81\uff0c\u4f46\u5982\u679c\u4f60\u78ba\u5b9a\u4f60\u7684\u672c\u5730\u7248\u672c\u5c31\u662f\u6700\u65b0\u7684\u7248\u672c\uff0c\u8ddf\u5718\u968a\u6210\u54e1\u5546\u8a0e\u904e\u5f8c\u53ef\u4ee5\u76f4\u63a5\u57f7\u884c\u5f37\u5236\u5408\u4f75: \u5728\u7d42\u7aef\u6a5f\u4e2dcd\u9032\u5165\u5c08\u6848\u8cc7\u6599\u593e\u7136\u5f8c\u8f38\u5165 git remote -v \u53ef\u4ee5\u6aa2\u8996\u7576\u524d\u5404\u500b\u5206\u652f\u7684\u6307\u5411\uff0c\u5728\u6a19\u6e96\u7684 Git \u5354\u4f5c\u6d41\u7a0b\u4e2d\uff1a origin\uff1a\u61c9\u8a72\u6307\u5411\u4f60\u7684 \u500b\u4eba Fork\uff08HarryChen1029\/cell-front-end\uff09\u3002 upstream\uff1a\u61c9\u8a72\u6307\u5411 \u539f\u59cb\u5c08\u6848\u4e3b\u5009\u5eab\uff08\u901a\u5e38\u662f birc-web\/cell-front-end \u6216\u7d44\u7e54\u5e33\u865f\uff09\u3002 \u5982\u679c\u6709\u6307\u5411\u932f\u8aa4\uff0c\u53ef\u4ee5\u5148\u522a\u9664\u932f\u8aa4\u7684 upstream git remote remove {Wrong Branch} \u518d\u63db\u6210\u771f\u6b63\u7684\u5c08\u6848\u4e3b\u8def\u5f91 git remote add upstream https:\/\/gitlab.ntubimdbirc.tw\/{Project Name}.git \u7b2c\u4e00\u6b65\uff1a\u6e05\u7406\u4e26\u78ba\u8a8d\u672c\u5730\u72c0\u614b \u5148\u78ba\u4fdd\u4f60\u7684\u672c\u5730 dev \u5206\u652f\u662f\u6700\u4e7e\u6de8\u3001\u6700\u65b0\u7684\u72c0\u614b\u3002 # \u78ba\u4fdd\u5728 dev \u5206\u652f git checkout dev # (\u9078\u505a) \u5982\u679c\u4f60\u60f3\u653e\u68c4\u6240\u6709\u672c\u5730\u672a\u5b58\u6a94\u7684\u96dc\u4e82\u6539\u52d5 (.env \u7b49) git restore . \u7b2c\u4e8c\u6b65\uff1a\u5c07\u4e3b\u5009\u5eab (Upstream) \u7684\u66f4\u65b0\u6293\u4e0b\u4f86\u89e3\u6c7a \u5373\u4f7f\u8981\u5f37\u5236\u5408\u4f75\uff0c\u6700\u597d\u7684\u505a\u6cd5\u9084\u662f\u5148\u8b93\u672c\u5730\u300c\u541e\u6389\u300d\u9060\u7aef\u7684\u66f4\u65b0\uff0c\u9019\u6a23\u53ef\u4ee5\u907f\u514d Pipeline \u57f7\u884c\u5931\u6557\u3002\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"H.Y. Chen\"\/>\n\t<meta name=\"google-site-verification\" content=\"-324YR5tomynX5FeTW2lTMHIX0KmPBvpxjXpOhXwi1Q\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/hyc.eshachem.com\/program\/git-%e5%bc%b7%e5%88%b6%e5%90%88%e4%bd%b5\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.10\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"HyC Wiki - Technical articles\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"GIT: \u672c\u5730\u5f37\u5236\u5408\u4f75\u5230upstream - HyC Wiki\" \/>\n\t\t<meta property=\"og:description\" content=\"\u592a\u4e45\u6c92\u6709\u62c9\u6771\u897f\u4e0b\u4f86\u6642\uff0c\u5728gitlab\u8981merge Request\u6642\u6703\u9047\u5230\u5408\u4f75\u885d\u7a81\uff0c\u4f46\u5982\u679c\u4f60\u78ba\u5b9a\u4f60\u7684\u672c\u5730\u7248\u672c\u5c31\u662f\u6700\u65b0\u7684\u7248\u672c\uff0c\u8ddf\u5718\u968a\u6210\u54e1\u5546\u8a0e\u904e\u5f8c\u53ef\u4ee5\u76f4\u63a5\u57f7\u884c\u5f37\u5236\u5408\u4f75: \u5728\u7d42\u7aef\u6a5f\u4e2dcd\u9032\u5165\u5c08\u6848\u8cc7\u6599\u593e\u7136\u5f8c\u8f38\u5165 git remote -v \u53ef\u4ee5\u6aa2\u8996\u7576\u524d\u5404\u500b\u5206\u652f\u7684\u6307\u5411\uff0c\u5728\u6a19\u6e96\u7684 Git \u5354\u4f5c\u6d41\u7a0b\u4e2d\uff1a origin\uff1a\u61c9\u8a72\u6307\u5411\u4f60\u7684 \u500b\u4eba Fork\uff08HarryChen1029\/cell-front-end\uff09\u3002 upstream\uff1a\u61c9\u8a72\u6307\u5411 \u539f\u59cb\u5c08\u6848\u4e3b\u5009\u5eab\uff08\u901a\u5e38\u662f birc-web\/cell-front-end \u6216\u7d44\u7e54\u5e33\u865f\uff09\u3002 \u5982\u679c\u6709\u6307\u5411\u932f\u8aa4\uff0c\u53ef\u4ee5\u5148\u522a\u9664\u932f\u8aa4\u7684 upstream git remote remove {Wrong Branch} \u518d\u63db\u6210\u771f\u6b63\u7684\u5c08\u6848\u4e3b\u8def\u5f91 git remote add upstream https:\/\/gitlab.ntubimdbirc.tw\/{Project Name}.git \u7b2c\u4e00\u6b65\uff1a\u6e05\u7406\u4e26\u78ba\u8a8d\u672c\u5730\u72c0\u614b \u5148\u78ba\u4fdd\u4f60\u7684\u672c\u5730 dev \u5206\u652f\u662f\u6700\u4e7e\u6de8\u3001\u6700\u65b0\u7684\u72c0\u614b\u3002 # \u78ba\u4fdd\u5728 dev \u5206\u652f git checkout dev # (\u9078\u505a) \u5982\u679c\u4f60\u60f3\u653e\u68c4\u6240\u6709\u672c\u5730\u672a\u5b58\u6a94\u7684\u96dc\u4e82\u6539\u52d5 (.env \u7b49) git restore . \u7b2c\u4e8c\u6b65\uff1a\u5c07\u4e3b\u5009\u5eab (Upstream) \u7684\u66f4\u65b0\u6293\u4e0b\u4f86\u89e3\u6c7a \u5373\u4f7f\u8981\u5f37\u5236\u5408\u4f75\uff0c\u6700\u597d\u7684\u505a\u6cd5\u9084\u662f\u5148\u8b93\u672c\u5730\u300c\u541e\u6389\u300d\u9060\u7aef\u7684\u66f4\u65b0\uff0c\u9019\u6a23\u53ef\u4ee5\u907f\u514d Pipeline \u57f7\u884c\u5931\u6557\u3002\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/hyc.eshachem.com\/program\/git-%e5%bc%b7%e5%88%b6%e5%90%88%e4%bd%b5\/\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/hyc.eshachem.com\/program\/wp-content\/uploads\/2026\/06\/cropped-cropped-\u672a\u547d\u540d\u8a2d\u8a08-4.png\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/hyc.eshachem.com\/program\/wp-content\/uploads\/2026\/06\/cropped-cropped-\u672a\u547d\u540d\u8a2d\u8a08-4.png\" \/>\n\t\t<meta property=\"og:image:width\" content=\"64\" \/>\n\t\t<meta property=\"og:image:height\" content=\"64\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2026-03-08T14:03:09+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2026-04-14T12:57:12+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n\t\t<meta name=\"twitter:title\" content=\"GIT: \u672c\u5730\u5f37\u5236\u5408\u4f75\u5230upstream - HyC Wiki\" \/>\n\t\t<meta name=\"twitter:description\" content=\"\u592a\u4e45\u6c92\u6709\u62c9\u6771\u897f\u4e0b\u4f86\u6642\uff0c\u5728gitlab\u8981merge Request\u6642\u6703\u9047\u5230\u5408\u4f75\u885d\u7a81\uff0c\u4f46\u5982\u679c\u4f60\u78ba\u5b9a\u4f60\u7684\u672c\u5730\u7248\u672c\u5c31\u662f\u6700\u65b0\u7684\u7248\u672c\uff0c\u8ddf\u5718\u968a\u6210\u54e1\u5546\u8a0e\u904e\u5f8c\u53ef\u4ee5\u76f4\u63a5\u57f7\u884c\u5f37\u5236\u5408\u4f75: \u5728\u7d42\u7aef\u6a5f\u4e2dcd\u9032\u5165\u5c08\u6848\u8cc7\u6599\u593e\u7136\u5f8c\u8f38\u5165 git remote -v \u53ef\u4ee5\u6aa2\u8996\u7576\u524d\u5404\u500b\u5206\u652f\u7684\u6307\u5411\uff0c\u5728\u6a19\u6e96\u7684 Git \u5354\u4f5c\u6d41\u7a0b\u4e2d\uff1a origin\uff1a\u61c9\u8a72\u6307\u5411\u4f60\u7684 \u500b\u4eba Fork\uff08HarryChen1029\/cell-front-end\uff09\u3002 upstream\uff1a\u61c9\u8a72\u6307\u5411 \u539f\u59cb\u5c08\u6848\u4e3b\u5009\u5eab\uff08\u901a\u5e38\u662f birc-web\/cell-front-end \u6216\u7d44\u7e54\u5e33\u865f\uff09\u3002 \u5982\u679c\u6709\u6307\u5411\u932f\u8aa4\uff0c\u53ef\u4ee5\u5148\u522a\u9664\u932f\u8aa4\u7684 upstream git remote remove {Wrong Branch} \u518d\u63db\u6210\u771f\u6b63\u7684\u5c08\u6848\u4e3b\u8def\u5f91 git remote add upstream https:\/\/gitlab.ntubimdbirc.tw\/{Project Name}.git \u7b2c\u4e00\u6b65\uff1a\u6e05\u7406\u4e26\u78ba\u8a8d\u672c\u5730\u72c0\u614b \u5148\u78ba\u4fdd\u4f60\u7684\u672c\u5730 dev \u5206\u652f\u662f\u6700\u4e7e\u6de8\u3001\u6700\u65b0\u7684\u72c0\u614b\u3002 # \u78ba\u4fdd\u5728 dev \u5206\u652f git checkout dev # (\u9078\u505a) \u5982\u679c\u4f60\u60f3\u653e\u68c4\u6240\u6709\u672c\u5730\u672a\u5b58\u6a94\u7684\u96dc\u4e82\u6539\u52d5 (.env \u7b49) git restore . \u7b2c\u4e8c\u6b65\uff1a\u5c07\u4e3b\u5009\u5eab (Upstream) \u7684\u66f4\u65b0\u6293\u4e0b\u4f86\u89e3\u6c7a \u5373\u4f7f\u8981\u5f37\u5236\u5408\u4f75\uff0c\u6700\u597d\u7684\u505a\u6cd5\u9084\u662f\u5148\u8b93\u672c\u5730\u300c\u541e\u6389\u300d\u9060\u7aef\u7684\u66f4\u65b0\uff0c\u9019\u6a23\u53ef\u4ee5\u907f\u514d Pipeline \u57f7\u884c\u5931\u6557\u3002\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/hyc.eshachem.com\/program\/wp-content\/uploads\/2026\/06\/cropped-cropped-\u672a\u547d\u540d\u8a2d\u8a08-4.png\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"BlogPosting\",\"@id\":\"https:\\\/\\\/hyc.eshachem.com\\\/program\\\/git-%e5%bc%b7%e5%88%b6%e5%90%88%e4%bd%b5\\\/#blogposting\",\"name\":\"GIT: \\u672c\\u5730\\u5f37\\u5236\\u5408\\u4f75\\u5230upstream - HyC Wiki\",\"headline\":\"GIT: \\u672c\\u5730\\u5f37\\u5236\\u5408\\u4f75\\u5230upstream\",\"author\":{\"@id\":\"https:\\\/\\\/hyc.eshachem.com\\\/program\\\/author\\\/hychen\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/hyc.eshachem.com\\\/program\\\/#person\"},\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/hyc.eshachem.com\\\/program\\\/git-%e5%bc%b7%e5%88%b6%e5%90%88%e4%bd%b5\\\/#articleImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/fc6e05e080c9ea570267ee9ed68c8b1841d745cee07c0331c5440646e0646603?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"H.Y. Chen\"},\"datePublished\":\"2026-03-08T14:03:09+00:00\",\"dateModified\":\"2026-04-14T12:57:12+00:00\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/hyc.eshachem.com\\\/program\\\/git-%e5%bc%b7%e5%88%b6%e5%90%88%e4%bd%b5\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/hyc.eshachem.com\\\/program\\\/git-%e5%bc%b7%e5%88%b6%e5%90%88%e4%bd%b5\\\/#webpage\"},\"articleSection\":\"Git\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/hyc.eshachem.com\\\/program\\\/git-%e5%bc%b7%e5%88%b6%e5%90%88%e4%bd%b5\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/hyc.eshachem.com\\\/program#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/hyc.eshachem.com\\\/program\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/hyc.eshachem.com\\\/program\\\/category\\\/git\\\/#listItem\",\"name\":\"Git\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/hyc.eshachem.com\\\/program\\\/category\\\/git\\\/#listItem\",\"position\":2,\"name\":\"Git\",\"item\":\"https:\\\/\\\/hyc.eshachem.com\\\/program\\\/category\\\/git\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/hyc.eshachem.com\\\/program\\\/git-%e5%bc%b7%e5%88%b6%e5%90%88%e4%bd%b5\\\/#listItem\",\"name\":\"GIT: \\u672c\\u5730\\u5f37\\u5236\\u5408\\u4f75\\u5230upstream\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/hyc.eshachem.com\\\/program#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/hyc.eshachem.com\\\/program\\\/git-%e5%bc%b7%e5%88%b6%e5%90%88%e4%bd%b5\\\/#listItem\",\"position\":3,\"name\":\"GIT: \\u672c\\u5730\\u5f37\\u5236\\u5408\\u4f75\\u5230upstream\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/hyc.eshachem.com\\\/program\\\/category\\\/git\\\/#listItem\",\"name\":\"Git\"}}]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/hyc.eshachem.com\\\/program\\\/#person\",\"name\":\"H.Y. Chen\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/hyc.eshachem.com\\\/program\\\/git-%e5%bc%b7%e5%88%b6%e5%90%88%e4%bd%b5\\\/#personImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/fc6e05e080c9ea570267ee9ed68c8b1841d745cee07c0331c5440646e0646603?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"H.Y. Chen\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/hyc.eshachem.com\\\/program\\\/author\\\/hychen\\\/#author\",\"url\":\"https:\\\/\\\/hyc.eshachem.com\\\/program\\\/author\\\/hychen\\\/\",\"name\":\"H.Y. Chen\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/hyc.eshachem.com\\\/program\\\/git-%e5%bc%b7%e5%88%b6%e5%90%88%e4%bd%b5\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/fc6e05e080c9ea570267ee9ed68c8b1841d745cee07c0331c5440646e0646603?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"H.Y. Chen\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/hyc.eshachem.com\\\/program\\\/git-%e5%bc%b7%e5%88%b6%e5%90%88%e4%bd%b5\\\/#webpage\",\"url\":\"https:\\\/\\\/hyc.eshachem.com\\\/program\\\/git-%e5%bc%b7%e5%88%b6%e5%90%88%e4%bd%b5\\\/\",\"name\":\"GIT: \\u672c\\u5730\\u5f37\\u5236\\u5408\\u4f75\\u5230upstream - HyC Wiki\",\"description\":\"\\u592a\\u4e45\\u6c92\\u6709\\u62c9\\u6771\\u897f\\u4e0b\\u4f86\\u6642\\uff0c\\u5728gitlab\\u8981merge Request\\u6642\\u6703\\u9047\\u5230\\u5408\\u4f75\\u885d\\u7a81\\uff0c\\u4f46\\u5982\\u679c\\u4f60\\u78ba\\u5b9a\\u4f60\\u7684\\u672c\\u5730\\u7248\\u672c\\u5c31\\u662f\\u6700\\u65b0\\u7684\\u7248\\u672c\\uff0c\\u8ddf\\u5718\\u968a\\u6210\\u54e1\\u5546\\u8a0e\\u904e\\u5f8c\\u53ef\\u4ee5\\u76f4\\u63a5\\u57f7\\u884c\\u5f37\\u5236\\u5408\\u4f75: \\u5728\\u7d42\\u7aef\\u6a5f\\u4e2dcd\\u9032\\u5165\\u5c08\\u6848\\u8cc7\\u6599\\u593e\\u7136\\u5f8c\\u8f38\\u5165 git remote -v \\u53ef\\u4ee5\\u6aa2\\u8996\\u7576\\u524d\\u5404\\u500b\\u5206\\u652f\\u7684\\u6307\\u5411\\uff0c\\u5728\\u6a19\\u6e96\\u7684 Git \\u5354\\u4f5c\\u6d41\\u7a0b\\u4e2d\\uff1a origin\\uff1a\\u61c9\\u8a72\\u6307\\u5411\\u4f60\\u7684 \\u500b\\u4eba Fork\\uff08HarryChen1029\\\/cell-front-end\\uff09\\u3002 upstream\\uff1a\\u61c9\\u8a72\\u6307\\u5411 \\u539f\\u59cb\\u5c08\\u6848\\u4e3b\\u5009\\u5eab\\uff08\\u901a\\u5e38\\u662f birc-web\\\/cell-front-end \\u6216\\u7d44\\u7e54\\u5e33\\u865f\\uff09\\u3002 \\u5982\\u679c\\u6709\\u6307\\u5411\\u932f\\u8aa4\\uff0c\\u53ef\\u4ee5\\u5148\\u522a\\u9664\\u932f\\u8aa4\\u7684 upstream git remote remove {Wrong Branch} \\u518d\\u63db\\u6210\\u771f\\u6b63\\u7684\\u5c08\\u6848\\u4e3b\\u8def\\u5f91 git remote add upstream https:\\\/\\\/gitlab.ntubimdbirc.tw\\\/{Project Name}.git \\u7b2c\\u4e00\\u6b65\\uff1a\\u6e05\\u7406\\u4e26\\u78ba\\u8a8d\\u672c\\u5730\\u72c0\\u614b \\u5148\\u78ba\\u4fdd\\u4f60\\u7684\\u672c\\u5730 dev \\u5206\\u652f\\u662f\\u6700\\u4e7e\\u6de8\\u3001\\u6700\\u65b0\\u7684\\u72c0\\u614b\\u3002 # \\u78ba\\u4fdd\\u5728 dev \\u5206\\u652f git checkout dev # (\\u9078\\u505a) \\u5982\\u679c\\u4f60\\u60f3\\u653e\\u68c4\\u6240\\u6709\\u672c\\u5730\\u672a\\u5b58\\u6a94\\u7684\\u96dc\\u4e82\\u6539\\u52d5 (.env \\u7b49) git restore . \\u7b2c\\u4e8c\\u6b65\\uff1a\\u5c07\\u4e3b\\u5009\\u5eab (Upstream) \\u7684\\u66f4\\u65b0\\u6293\\u4e0b\\u4f86\\u89e3\\u6c7a \\u5373\\u4f7f\\u8981\\u5f37\\u5236\\u5408\\u4f75\\uff0c\\u6700\\u597d\\u7684\\u505a\\u6cd5\\u9084\\u662f\\u5148\\u8b93\\u672c\\u5730\\u300c\\u541e\\u6389\\u300d\\u9060\\u7aef\\u7684\\u66f4\\u65b0\\uff0c\\u9019\\u6a23\\u53ef\\u4ee5\\u907f\\u514d Pipeline \\u57f7\\u884c\\u5931\\u6557\\u3002\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/hyc.eshachem.com\\\/program\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/hyc.eshachem.com\\\/program\\\/git-%e5%bc%b7%e5%88%b6%e5%90%88%e4%bd%b5\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/hyc.eshachem.com\\\/program\\\/author\\\/hychen\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/hyc.eshachem.com\\\/program\\\/author\\\/hychen\\\/#author\"},\"datePublished\":\"2026-03-08T14:03:09+00:00\",\"dateModified\":\"2026-04-14T12:57:12+00:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/hyc.eshachem.com\\\/program\\\/#website\",\"url\":\"https:\\\/\\\/hyc.eshachem.com\\\/program\\\/\",\"name\":\"HyC Wiki\",\"description\":\"Technical articles\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/hyc.eshachem.com\\\/program\\\/#person\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"GIT: \u672c\u5730\u5f37\u5236\u5408\u4f75\u5230upstream - HyC Wiki","description":"\u592a\u4e45\u6c92\u6709\u62c9\u6771\u897f\u4e0b\u4f86\u6642\uff0c\u5728gitlab\u8981merge Request\u6642\u6703\u9047\u5230\u5408\u4f75\u885d\u7a81\uff0c\u4f46\u5982\u679c\u4f60\u78ba\u5b9a\u4f60\u7684\u672c\u5730\u7248\u672c\u5c31\u662f\u6700\u65b0\u7684\u7248\u672c\uff0c\u8ddf\u5718\u968a\u6210\u54e1\u5546\u8a0e\u904e\u5f8c\u53ef\u4ee5\u76f4\u63a5\u57f7\u884c\u5f37\u5236\u5408\u4f75: \u5728\u7d42\u7aef\u6a5f\u4e2dcd\u9032\u5165\u5c08\u6848\u8cc7\u6599\u593e\u7136\u5f8c\u8f38\u5165 git remote -v \u53ef\u4ee5\u6aa2\u8996\u7576\u524d\u5404\u500b\u5206\u652f\u7684\u6307\u5411\uff0c\u5728\u6a19\u6e96\u7684 Git \u5354\u4f5c\u6d41\u7a0b\u4e2d\uff1a origin\uff1a\u61c9\u8a72\u6307\u5411\u4f60\u7684 \u500b\u4eba Fork\uff08HarryChen1029\/cell-front-end\uff09\u3002 upstream\uff1a\u61c9\u8a72\u6307\u5411 \u539f\u59cb\u5c08\u6848\u4e3b\u5009\u5eab\uff08\u901a\u5e38\u662f birc-web\/cell-front-end \u6216\u7d44\u7e54\u5e33\u865f\uff09\u3002 \u5982\u679c\u6709\u6307\u5411\u932f\u8aa4\uff0c\u53ef\u4ee5\u5148\u522a\u9664\u932f\u8aa4\u7684 upstream git remote remove {Wrong Branch} \u518d\u63db\u6210\u771f\u6b63\u7684\u5c08\u6848\u4e3b\u8def\u5f91 git remote add upstream https:\/\/gitlab.ntubimdbirc.tw\/{Project Name}.git \u7b2c\u4e00\u6b65\uff1a\u6e05\u7406\u4e26\u78ba\u8a8d\u672c\u5730\u72c0\u614b \u5148\u78ba\u4fdd\u4f60\u7684\u672c\u5730 dev \u5206\u652f\u662f\u6700\u4e7e\u6de8\u3001\u6700\u65b0\u7684\u72c0\u614b\u3002 # \u78ba\u4fdd\u5728 dev \u5206\u652f git checkout dev # (\u9078\u505a) \u5982\u679c\u4f60\u60f3\u653e\u68c4\u6240\u6709\u672c\u5730\u672a\u5b58\u6a94\u7684\u96dc\u4e82\u6539\u52d5 (.env \u7b49) git restore . \u7b2c\u4e8c\u6b65\uff1a\u5c07\u4e3b\u5009\u5eab (Upstream) \u7684\u66f4\u65b0\u6293\u4e0b\u4f86\u89e3\u6c7a \u5373\u4f7f\u8981\u5f37\u5236\u5408\u4f75\uff0c\u6700\u597d\u7684\u505a\u6cd5\u9084\u662f\u5148\u8b93\u672c\u5730\u300c\u541e\u6389\u300d\u9060\u7aef\u7684\u66f4\u65b0\uff0c\u9019\u6a23\u53ef\u4ee5\u907f\u514d Pipeline \u57f7\u884c\u5931\u6557\u3002","canonical_url":"https:\/\/hyc.eshachem.com\/program\/git-%e5%bc%b7%e5%88%b6%e5%90%88%e4%bd%b5\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"google-site-verification":"-324YR5tomynX5FeTW2lTMHIX0KmPBvpxjXpOhXwi1Q","miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"BlogPosting","@id":"https:\/\/hyc.eshachem.com\/program\/git-%e5%bc%b7%e5%88%b6%e5%90%88%e4%bd%b5\/#blogposting","name":"GIT: \u672c\u5730\u5f37\u5236\u5408\u4f75\u5230upstream - HyC Wiki","headline":"GIT: \u672c\u5730\u5f37\u5236\u5408\u4f75\u5230upstream","author":{"@id":"https:\/\/hyc.eshachem.com\/program\/author\/hychen\/#author"},"publisher":{"@id":"https:\/\/hyc.eshachem.com\/program\/#person"},"image":{"@type":"ImageObject","@id":"https:\/\/hyc.eshachem.com\/program\/git-%e5%bc%b7%e5%88%b6%e5%90%88%e4%bd%b5\/#articleImage","url":"https:\/\/secure.gravatar.com\/avatar\/fc6e05e080c9ea570267ee9ed68c8b1841d745cee07c0331c5440646e0646603?s=96&d=mm&r=g","width":96,"height":96,"caption":"H.Y. Chen"},"datePublished":"2026-03-08T14:03:09+00:00","dateModified":"2026-04-14T12:57:12+00:00","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/hyc.eshachem.com\/program\/git-%e5%bc%b7%e5%88%b6%e5%90%88%e4%bd%b5\/#webpage"},"isPartOf":{"@id":"https:\/\/hyc.eshachem.com\/program\/git-%e5%bc%b7%e5%88%b6%e5%90%88%e4%bd%b5\/#webpage"},"articleSection":"Git"},{"@type":"BreadcrumbList","@id":"https:\/\/hyc.eshachem.com\/program\/git-%e5%bc%b7%e5%88%b6%e5%90%88%e4%bd%b5\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/hyc.eshachem.com\/program#listItem","position":1,"name":"Home","item":"https:\/\/hyc.eshachem.com\/program","nextItem":{"@type":"ListItem","@id":"https:\/\/hyc.eshachem.com\/program\/category\/git\/#listItem","name":"Git"}},{"@type":"ListItem","@id":"https:\/\/hyc.eshachem.com\/program\/category\/git\/#listItem","position":2,"name":"Git","item":"https:\/\/hyc.eshachem.com\/program\/category\/git\/","nextItem":{"@type":"ListItem","@id":"https:\/\/hyc.eshachem.com\/program\/git-%e5%bc%b7%e5%88%b6%e5%90%88%e4%bd%b5\/#listItem","name":"GIT: \u672c\u5730\u5f37\u5236\u5408\u4f75\u5230upstream"},"previousItem":{"@type":"ListItem","@id":"https:\/\/hyc.eshachem.com\/program#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/hyc.eshachem.com\/program\/git-%e5%bc%b7%e5%88%b6%e5%90%88%e4%bd%b5\/#listItem","position":3,"name":"GIT: \u672c\u5730\u5f37\u5236\u5408\u4f75\u5230upstream","previousItem":{"@type":"ListItem","@id":"https:\/\/hyc.eshachem.com\/program\/category\/git\/#listItem","name":"Git"}}]},{"@type":"Person","@id":"https:\/\/hyc.eshachem.com\/program\/#person","name":"H.Y. Chen","image":{"@type":"ImageObject","@id":"https:\/\/hyc.eshachem.com\/program\/git-%e5%bc%b7%e5%88%b6%e5%90%88%e4%bd%b5\/#personImage","url":"https:\/\/secure.gravatar.com\/avatar\/fc6e05e080c9ea570267ee9ed68c8b1841d745cee07c0331c5440646e0646603?s=96&d=mm&r=g","width":96,"height":96,"caption":"H.Y. Chen"}},{"@type":"Person","@id":"https:\/\/hyc.eshachem.com\/program\/author\/hychen\/#author","url":"https:\/\/hyc.eshachem.com\/program\/author\/hychen\/","name":"H.Y. Chen","image":{"@type":"ImageObject","@id":"https:\/\/hyc.eshachem.com\/program\/git-%e5%bc%b7%e5%88%b6%e5%90%88%e4%bd%b5\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/fc6e05e080c9ea570267ee9ed68c8b1841d745cee07c0331c5440646e0646603?s=96&d=mm&r=g","width":96,"height":96,"caption":"H.Y. Chen"}},{"@type":"WebPage","@id":"https:\/\/hyc.eshachem.com\/program\/git-%e5%bc%b7%e5%88%b6%e5%90%88%e4%bd%b5\/#webpage","url":"https:\/\/hyc.eshachem.com\/program\/git-%e5%bc%b7%e5%88%b6%e5%90%88%e4%bd%b5\/","name":"GIT: \u672c\u5730\u5f37\u5236\u5408\u4f75\u5230upstream - HyC Wiki","description":"\u592a\u4e45\u6c92\u6709\u62c9\u6771\u897f\u4e0b\u4f86\u6642\uff0c\u5728gitlab\u8981merge Request\u6642\u6703\u9047\u5230\u5408\u4f75\u885d\u7a81\uff0c\u4f46\u5982\u679c\u4f60\u78ba\u5b9a\u4f60\u7684\u672c\u5730\u7248\u672c\u5c31\u662f\u6700\u65b0\u7684\u7248\u672c\uff0c\u8ddf\u5718\u968a\u6210\u54e1\u5546\u8a0e\u904e\u5f8c\u53ef\u4ee5\u76f4\u63a5\u57f7\u884c\u5f37\u5236\u5408\u4f75: \u5728\u7d42\u7aef\u6a5f\u4e2dcd\u9032\u5165\u5c08\u6848\u8cc7\u6599\u593e\u7136\u5f8c\u8f38\u5165 git remote -v \u53ef\u4ee5\u6aa2\u8996\u7576\u524d\u5404\u500b\u5206\u652f\u7684\u6307\u5411\uff0c\u5728\u6a19\u6e96\u7684 Git \u5354\u4f5c\u6d41\u7a0b\u4e2d\uff1a origin\uff1a\u61c9\u8a72\u6307\u5411\u4f60\u7684 \u500b\u4eba Fork\uff08HarryChen1029\/cell-front-end\uff09\u3002 upstream\uff1a\u61c9\u8a72\u6307\u5411 \u539f\u59cb\u5c08\u6848\u4e3b\u5009\u5eab\uff08\u901a\u5e38\u662f birc-web\/cell-front-end \u6216\u7d44\u7e54\u5e33\u865f\uff09\u3002 \u5982\u679c\u6709\u6307\u5411\u932f\u8aa4\uff0c\u53ef\u4ee5\u5148\u522a\u9664\u932f\u8aa4\u7684 upstream git remote remove {Wrong Branch} \u518d\u63db\u6210\u771f\u6b63\u7684\u5c08\u6848\u4e3b\u8def\u5f91 git remote add upstream https:\/\/gitlab.ntubimdbirc.tw\/{Project Name}.git \u7b2c\u4e00\u6b65\uff1a\u6e05\u7406\u4e26\u78ba\u8a8d\u672c\u5730\u72c0\u614b \u5148\u78ba\u4fdd\u4f60\u7684\u672c\u5730 dev \u5206\u652f\u662f\u6700\u4e7e\u6de8\u3001\u6700\u65b0\u7684\u72c0\u614b\u3002 # \u78ba\u4fdd\u5728 dev \u5206\u652f git checkout dev # (\u9078\u505a) \u5982\u679c\u4f60\u60f3\u653e\u68c4\u6240\u6709\u672c\u5730\u672a\u5b58\u6a94\u7684\u96dc\u4e82\u6539\u52d5 (.env \u7b49) git restore . \u7b2c\u4e8c\u6b65\uff1a\u5c07\u4e3b\u5009\u5eab (Upstream) \u7684\u66f4\u65b0\u6293\u4e0b\u4f86\u89e3\u6c7a \u5373\u4f7f\u8981\u5f37\u5236\u5408\u4f75\uff0c\u6700\u597d\u7684\u505a\u6cd5\u9084\u662f\u5148\u8b93\u672c\u5730\u300c\u541e\u6389\u300d\u9060\u7aef\u7684\u66f4\u65b0\uff0c\u9019\u6a23\u53ef\u4ee5\u907f\u514d Pipeline \u57f7\u884c\u5931\u6557\u3002","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/hyc.eshachem.com\/program\/#website"},"breadcrumb":{"@id":"https:\/\/hyc.eshachem.com\/program\/git-%e5%bc%b7%e5%88%b6%e5%90%88%e4%bd%b5\/#breadcrumblist"},"author":{"@id":"https:\/\/hyc.eshachem.com\/program\/author\/hychen\/#author"},"creator":{"@id":"https:\/\/hyc.eshachem.com\/program\/author\/hychen\/#author"},"datePublished":"2026-03-08T14:03:09+00:00","dateModified":"2026-04-14T12:57:12+00:00"},{"@type":"WebSite","@id":"https:\/\/hyc.eshachem.com\/program\/#website","url":"https:\/\/hyc.eshachem.com\/program\/","name":"HyC Wiki","description":"Technical articles","inLanguage":"en-US","publisher":{"@id":"https:\/\/hyc.eshachem.com\/program\/#person"}}]},"og:locale":"en_US","og:site_name":"HyC Wiki - Technical articles","og:type":"article","og:title":"GIT: \u672c\u5730\u5f37\u5236\u5408\u4f75\u5230upstream - HyC Wiki","og:description":"\u592a\u4e45\u6c92\u6709\u62c9\u6771\u897f\u4e0b\u4f86\u6642\uff0c\u5728gitlab\u8981merge Request\u6642\u6703\u9047\u5230\u5408\u4f75\u885d\u7a81\uff0c\u4f46\u5982\u679c\u4f60\u78ba\u5b9a\u4f60\u7684\u672c\u5730\u7248\u672c\u5c31\u662f\u6700\u65b0\u7684\u7248\u672c\uff0c\u8ddf\u5718\u968a\u6210\u54e1\u5546\u8a0e\u904e\u5f8c\u53ef\u4ee5\u76f4\u63a5\u57f7\u884c\u5f37\u5236\u5408\u4f75: \u5728\u7d42\u7aef\u6a5f\u4e2dcd\u9032\u5165\u5c08\u6848\u8cc7\u6599\u593e\u7136\u5f8c\u8f38\u5165 git remote -v \u53ef\u4ee5\u6aa2\u8996\u7576\u524d\u5404\u500b\u5206\u652f\u7684\u6307\u5411\uff0c\u5728\u6a19\u6e96\u7684 Git \u5354\u4f5c\u6d41\u7a0b\u4e2d\uff1a origin\uff1a\u61c9\u8a72\u6307\u5411\u4f60\u7684 \u500b\u4eba Fork\uff08HarryChen1029\/cell-front-end\uff09\u3002 upstream\uff1a\u61c9\u8a72\u6307\u5411 \u539f\u59cb\u5c08\u6848\u4e3b\u5009\u5eab\uff08\u901a\u5e38\u662f birc-web\/cell-front-end \u6216\u7d44\u7e54\u5e33\u865f\uff09\u3002 \u5982\u679c\u6709\u6307\u5411\u932f\u8aa4\uff0c\u53ef\u4ee5\u5148\u522a\u9664\u932f\u8aa4\u7684 upstream git remote remove {Wrong Branch} \u518d\u63db\u6210\u771f\u6b63\u7684\u5c08\u6848\u4e3b\u8def\u5f91 git remote add upstream https:\/\/gitlab.ntubimdbirc.tw\/{Project Name}.git \u7b2c\u4e00\u6b65\uff1a\u6e05\u7406\u4e26\u78ba\u8a8d\u672c\u5730\u72c0\u614b \u5148\u78ba\u4fdd\u4f60\u7684\u672c\u5730 dev \u5206\u652f\u662f\u6700\u4e7e\u6de8\u3001\u6700\u65b0\u7684\u72c0\u614b\u3002 # \u78ba\u4fdd\u5728 dev \u5206\u652f git checkout dev # (\u9078\u505a) \u5982\u679c\u4f60\u60f3\u653e\u68c4\u6240\u6709\u672c\u5730\u672a\u5b58\u6a94\u7684\u96dc\u4e82\u6539\u52d5 (.env \u7b49) git restore . \u7b2c\u4e8c\u6b65\uff1a\u5c07\u4e3b\u5009\u5eab (Upstream) \u7684\u66f4\u65b0\u6293\u4e0b\u4f86\u89e3\u6c7a \u5373\u4f7f\u8981\u5f37\u5236\u5408\u4f75\uff0c\u6700\u597d\u7684\u505a\u6cd5\u9084\u662f\u5148\u8b93\u672c\u5730\u300c\u541e\u6389\u300d\u9060\u7aef\u7684\u66f4\u65b0\uff0c\u9019\u6a23\u53ef\u4ee5\u907f\u514d Pipeline \u57f7\u884c\u5931\u6557\u3002","og:url":"https:\/\/hyc.eshachem.com\/program\/git-%e5%bc%b7%e5%88%b6%e5%90%88%e4%bd%b5\/","og:image":"https:\/\/hyc.eshachem.com\/program\/wp-content\/uploads\/2026\/06\/cropped-cropped-\u672a\u547d\u540d\u8a2d\u8a08-4.png","og:image:secure_url":"https:\/\/hyc.eshachem.com\/program\/wp-content\/uploads\/2026\/06\/cropped-cropped-\u672a\u547d\u540d\u8a2d\u8a08-4.png","og:image:width":64,"og:image:height":64,"article:published_time":"2026-03-08T14:03:09+00:00","article:modified_time":"2026-04-14T12:57:12+00:00","twitter:card":"summary_large_image","twitter:title":"GIT: \u672c\u5730\u5f37\u5236\u5408\u4f75\u5230upstream - HyC Wiki","twitter:description":"\u592a\u4e45\u6c92\u6709\u62c9\u6771\u897f\u4e0b\u4f86\u6642\uff0c\u5728gitlab\u8981merge Request\u6642\u6703\u9047\u5230\u5408\u4f75\u885d\u7a81\uff0c\u4f46\u5982\u679c\u4f60\u78ba\u5b9a\u4f60\u7684\u672c\u5730\u7248\u672c\u5c31\u662f\u6700\u65b0\u7684\u7248\u672c\uff0c\u8ddf\u5718\u968a\u6210\u54e1\u5546\u8a0e\u904e\u5f8c\u53ef\u4ee5\u76f4\u63a5\u57f7\u884c\u5f37\u5236\u5408\u4f75: \u5728\u7d42\u7aef\u6a5f\u4e2dcd\u9032\u5165\u5c08\u6848\u8cc7\u6599\u593e\u7136\u5f8c\u8f38\u5165 git remote -v \u53ef\u4ee5\u6aa2\u8996\u7576\u524d\u5404\u500b\u5206\u652f\u7684\u6307\u5411\uff0c\u5728\u6a19\u6e96\u7684 Git \u5354\u4f5c\u6d41\u7a0b\u4e2d\uff1a origin\uff1a\u61c9\u8a72\u6307\u5411\u4f60\u7684 \u500b\u4eba Fork\uff08HarryChen1029\/cell-front-end\uff09\u3002 upstream\uff1a\u61c9\u8a72\u6307\u5411 \u539f\u59cb\u5c08\u6848\u4e3b\u5009\u5eab\uff08\u901a\u5e38\u662f birc-web\/cell-front-end \u6216\u7d44\u7e54\u5e33\u865f\uff09\u3002 \u5982\u679c\u6709\u6307\u5411\u932f\u8aa4\uff0c\u53ef\u4ee5\u5148\u522a\u9664\u932f\u8aa4\u7684 upstream git remote remove {Wrong Branch} \u518d\u63db\u6210\u771f\u6b63\u7684\u5c08\u6848\u4e3b\u8def\u5f91 git remote add upstream https:\/\/gitlab.ntubimdbirc.tw\/{Project Name}.git \u7b2c\u4e00\u6b65\uff1a\u6e05\u7406\u4e26\u78ba\u8a8d\u672c\u5730\u72c0\u614b \u5148\u78ba\u4fdd\u4f60\u7684\u672c\u5730 dev \u5206\u652f\u662f\u6700\u4e7e\u6de8\u3001\u6700\u65b0\u7684\u72c0\u614b\u3002 # \u78ba\u4fdd\u5728 dev \u5206\u652f git checkout dev # (\u9078\u505a) \u5982\u679c\u4f60\u60f3\u653e\u68c4\u6240\u6709\u672c\u5730\u672a\u5b58\u6a94\u7684\u96dc\u4e82\u6539\u52d5 (.env \u7b49) git restore . \u7b2c\u4e8c\u6b65\uff1a\u5c07\u4e3b\u5009\u5eab (Upstream) \u7684\u66f4\u65b0\u6293\u4e0b\u4f86\u89e3\u6c7a \u5373\u4f7f\u8981\u5f37\u5236\u5408\u4f75\uff0c\u6700\u597d\u7684\u505a\u6cd5\u9084\u662f\u5148\u8b93\u672c\u5730\u300c\u541e\u6389\u300d\u9060\u7aef\u7684\u66f4\u65b0\uff0c\u9019\u6a23\u53ef\u4ee5\u907f\u514d Pipeline \u57f7\u884c\u5931\u6557\u3002","twitter:image":"https:\/\/hyc.eshachem.com\/program\/wp-content\/uploads\/2026\/06\/cropped-cropped-\u672a\u547d\u540d\u8a2d\u8a08-4.png"},"aioseo_meta_data":{"post_id":"255","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_custom_url":null,"og_image_custom_fields":null,"og_image_url":null,"og_image_width":null,"og_image_height":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_image_url":null,"twitter_title":null,"twitter_description":null,"schema_type":"default","schema_type_options":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"limit_modified_date":false,"ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null,"created":"2026-07-28 14:30:02","updated":"2026-07-28 14:30:02"},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/hyc.eshachem.com\/program\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/hyc.eshachem.com\/program\/category\/git\/\" title=\"Git\">Git<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tGIT: \u672c\u5730\u5f37\u5236\u5408\u4f75\u5230upstream\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/hyc.eshachem.com\/program"},{"label":"Git","link":"https:\/\/hyc.eshachem.com\/program\/category\/git\/"},{"label":"GIT: \u672c\u5730\u5f37\u5236\u5408\u4f75\u5230upstream","link":"https:\/\/hyc.eshachem.com\/program\/git-%e5%bc%b7%e5%88%b6%e5%90%88%e4%bd%b5\/"}],"views":29,"_links":{"self":[{"href":"https:\/\/hyc.eshachem.com\/program\/wp-json\/wp\/v2\/posts\/255","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hyc.eshachem.com\/program\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hyc.eshachem.com\/program\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hyc.eshachem.com\/program\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/hyc.eshachem.com\/program\/wp-json\/wp\/v2\/comments?post=255"}],"version-history":[{"count":2,"href":"https:\/\/hyc.eshachem.com\/program\/wp-json\/wp\/v2\/posts\/255\/revisions"}],"predecessor-version":[{"id":304,"href":"https:\/\/hyc.eshachem.com\/program\/wp-json\/wp\/v2\/posts\/255\/revisions\/304"}],"wp:attachment":[{"href":"https:\/\/hyc.eshachem.com\/program\/wp-json\/wp\/v2\/media?parent=255"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hyc.eshachem.com\/program\/wp-json\/wp\/v2\/categories?post=255"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hyc.eshachem.com\/program\/wp-json\/wp\/v2\/tags?post=255"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}