{"id":50304,"date":"2025-07-30T22:51:42","date_gmt":"2025-07-30T14:51:42","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/50304.html"},"modified":"2025-07-30T22:51:42","modified_gmt":"2025-07-30T14:51:42","slug":"gitlab-%e4%bb%93%e5%ba%93-%e5%b8%b8%e7%94%a8%e7%9a%84-git-%e5%91%bd%e4%bb%a4","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/50304.html","title":{"rendered":"GitLab \u4ed3\u5e93 \u2014 \u5e38\u7528\u7684 git \u547d\u4ee4"},"content":{"rendered":"<p>\u5728\u516c\u53f8\u7684 gitlab \u516c\u5171\u4ed3\u5e93\u4e2d\u5199\u4ee3\u7801\u505a\u9879\u76ee\u65f6&#xff0c;\u4e3b\u8981\u6d89\u53ca\u4ee5\u4e0b\u5e38\u7528 git \u547d\u4ee4&#xff1a;<\/p>\n<h2>\u4e00\u3001\u5355\u4e2a\u547d\u4ee4\u8bb2\u89e3<\/h2>\n<h3>1. \u62c9\u53d6\u4ee3\u7801<\/h3>\n<p>&#xff08;1&#xff09;git clone [\u4ed3\u5e93 URL]\u200c<\/p>\n<ul>\n<li>\n<p>\u514b\u9686\u8fdc\u7a0b\u4ed3\u5e93\u5230\u672c\u5730&#xff08;\u9700\u786e\u4fdd URL \u6b63\u786e&#xff09; \u200c<\/p>\n<\/li>\n<\/ul>\n<p>&#xff08;\u200c2&#xff09;git pull [\u8fdc\u7a0b\u4ed3\u5e93\u540d] [\u5206\u652f\u540d]\u200c<\/p>\n<ul>\n<li>\n<p>\u4ece\u8fdc\u7a0b\u4ed3\u5e93\u62c9\u53d6\u6700\u65b0\u4ee3\u7801&#xff08;\u9ed8\u8ba4\u62c9\u53d6 origin \u4ed3\u5e93\u7684 master\u00a0\u5206\u652f&#xff09;<\/p>\n<\/li>\n<\/ul>\n<p>&#xff08;3&#xff09;git fetch [\u8fdc\u7a0b\u4ed3\u5e93\u540d] [\u5206\u652f\u540d]\u200c<\/p>\n<ul>\n<li>\n<p>\u4ec5\u4e0b\u8f7d\u8fdc\u7a0b\u5206\u652f\u66f4\u65b0&#xff0c;\u4e0d\u81ea\u52a8\u5408\u5e76<\/p>\n<\/li>\n<\/ul>\n<h3>2. \u5206\u652f\u64cd\u4f5c<\/h3>\n<p>&#xff08;\u200c1&#xff09;git checkout [\u5206\u652f\u540d]\u200c<\/p>\n<ul>\n<li>\n<p>\u5207\u6362\u5230\u6307\u5b9a\u5206\u652f&#xff08;\u5982 master\u3001develop \u7b49&#xff09;<\/p>\n<\/li>\n<li>\n<p>\u52a0\u9009\u9879\u201c-b\u201d\u5373\u521b\u5efa\u5e76\u5207\u6362\u5230\u8be5\u5206\u652f<\/p>\n<\/li>\n<\/ul>\n<p>&#xff08;\u200c2&#xff09;git switch [\u5206\u652f\u540d]\u200c<\/p>\n<ul>\n<li>\n<p>\u5207\u6362\u5206\u652f&#xff08;\u4ec5 Git 2.23&#043; \u7248\u672c\u652f\u6301&#xff09;<\/p>\n<\/li>\n<\/ul>\n<p>&#xff08;\u200c3&#xff09;git branch [\u65b0\u5206\u652f\u540d]\u200c<\/p>\n<ul>\n<li>\n<p>\u521b\u5efa\u5e76\u5207\u6362\u5230\u65b0\u5206\u652f&#xff08;\u5982 feature-branch&#xff09;<\/p>\n<\/li>\n<\/ul>\n<p>&#xff08;4&#xff09;git merge [\u5206\u652f\u540d]<\/p>\n<ul>\n<li>\n<p>\u5c06\u6307\u5b9a\u5206\u652f\u7684\u4ee3\u7801\u5408\u5e76\u5230\u5f53\u524d\u5206\u652f<\/p>\n<\/li>\n<\/ul>\n<h3>3. \u4ee3\u7801\u7ba1\u7406<\/h3>\n<p>&#xff08;1&#xff09;git init<\/p>\n<ul>\n<li>\n<p>\u521d\u59cb\u5316\u4e00\u4e2a\u65b0\u7684 git \u4ed3\u5e93<\/p>\n<\/li>\n<li>\n<p>\u8fdb\u5165\u5230\u76ee\u6807\u6587\u4ef6\u5939&#xff0c;\u8fd0\u884c\u8be5\u547d\u4ee4\u5728\u5f53\u524d\u6587\u4ef6\u5939\u4e0b\u521b\u5efa\u4e00\u4e2a .git \u6587\u4ef6\u5939&#xff0c;\u4f5c\u4e3a git \u7684\u4ed3\u5e93<\/p>\n<\/li>\n<\/ul>\n<p>&#xff08;2&#xff09;git pull<\/p>\n<ul>\n<li>\n<p>\u66f4\u65b0\u672c\u5730\u4ed3\u5e93&#xff0c;\u5c06\u8fdc\u7a0b\u4ed3\u5e93\u7684\u6539\u52a8\u62c9\u53d6\u5230\u672c\u5730<\/p>\n<\/li>\n<li>\n<p>\u8fd0\u884c\u8be5\u547d\u4ee4\u547d\u4ee4\u66f4\u65b0\u672c\u5730\u4ed3\u5e93&#xff0c;\u5e76\u5c06\u8fdc\u7a0b\u4ed3\u5e93\u7684\u6539\u52a8\u62c9\u53d6\u5230\u672c\u5730<\/p>\n<\/li>\n<\/ul>\n<p>&#xff08;\u200c3&#xff09;git status\u200c<\/p>\n<ul>\n<li>\n<p>\u67e5\u770b\u672c\u5730\u4ed3\u5e93\u72b6\u6001&#xff08;\u662f\u5426\u9700\u8981\u63d0\u4ea4\u3001\u662f\u5426\u5b58\u5728\u51b2\u7a81\u7b49&#xff09;<\/p>\n<\/li>\n<li>\n<p>\u8fd0\u884c\u8be5\u547d\u4ee4\u53ef\u4ee5\u67e5\u770b\u9879\u76ee\u4e0b\u5b58\u5728\u6539\u52a8\u7684\u6240\u6709\u6587\u4ef6<\/p>\n<\/li>\n<\/ul>\n<p>&#xff08;4&#xff09;git diff [\u6587\u4ef6\u540d]<\/p>\n<ul>\n<li>\n<p>\u67e5\u770b\u6307\u5b9a\u6587\u4ef6\u7684\u8be6\u7ec6\u7684\u4fee\u6539\u5185\u5bb9<\/p>\n<\/li>\n<\/ul>\n<p>&#xff08;\u200c5&#xff09;git add [\u6587\u4ef6\u540d\/\u76ee\u5f55]\u200c<\/p>\n<ul>\n<li>\n<p>\u5c06\u6587\u4ef6\u6dfb\u52a0\u5230\u6682\u5b58\u533a<\/p>\n<\/li>\n<li>\n<p>\u5efa\u8bae\u6bcf\u6b21\u68c0\u67e5\u5b8c\u67d0\u4e2a\u6587\u4ef6\u5355\u72ec\u6267\u884c add&#xff0c;\u907f\u514d\u53ea\u7528\u201cadd .\u201d\u6279\u91cf\u6267\u884c\u64cd\u4f5c<\/p>\n<\/li>\n<\/ul>\n<p>&#xff08;\u200c6&#xff09;git commit -m &#034;\u63cf\u8ff0\u4fe1\u606f&#034;\u200c<\/p>\n<ul>\n<li>\n<p>\u63d0\u4ea4\u6682\u5b58\u533a\u7684\u4ee3\u7801&#xff08;\u9700\u914d\u5408 add \u547d\u4ee4\u4e00\u8d77\u4f7f\u7528&#xff09;<\/p>\n<\/li>\n<li>\n<p>\u201c\u63cf\u8ff0\u4fe1\u606f\u201d&#xff1a;\u63d0\u70bc\u51fa\u672c\u6b21\u63d0\u4ea4\u7684\u5173\u952e\u4fe1\u606f\u5373\u53ef<\/p>\n<\/li>\n<\/ul>\n<p>&#xff08;7&#xff09;git push -u origin [\u5206\u652f\u540d]<\/p>\n<ul>\n<li>\n<p>\u5c06\u672c\u5730\u4ed3\u5e93\u7684\u6539\u52a8\u63a8\u9001\u5230\u8fdc\u7a0b\u4ed3\u5e93<\/p>\n<\/li>\n<li>\n<p>\u5efa\u8bae\u63a8\u9001\u5230\u81ea\u5df1\u7684\u5206\u652f\u4e0a&#xff0c;\u907f\u514d\u5f71\u54cd\u516c\u5171\u4ed3\u5e93<\/p>\n<\/li>\n<li>\n<p>-u \u9009\u9879&#xff1a;\u5efa\u7acb\u672c\u5730\u5206\u652f\u4e0e\u8fdc\u7a0b\u5206\u652f\u7684\u8ddf\u8e2a\u5173\u7cfb<\/p>\n<\/li>\n<\/ul>\n<p>&#xff08;8&#xff09;git log<\/p>\n<ul>\n<li>\n<p>\u67e5\u770b\u63d0\u4ea4\u5386\u53f2\u8bb0\u5f55<\/p>\n<\/li>\n<\/ul>\n<h3>4. \u51b2\u7a81\u5904\u7406<\/h3>\n<p>&#xff08;\u200c1&#xff09;git rebase\u200c<\/p>\n<ul>\n<li>\n<p>\u5c06\u672c\u5730\u63d0\u4ea4\u91cd\u65b0\u6392\u5217\u5230\u8fdc\u7a0b\u5206\u652f\u6700\u65b0\u63d0\u4ea4\u4e4b\u4e0a&#xff08;\u4fdd\u6301\u7ebf\u6027\u5386\u53f2&#xff09;<\/p>\n<\/li>\n<\/ul>\n<p>&#xff08;2&#xff09;git merge [\u8fdc\u7a0b\u5206\u652f]\u200c<\/p>\n<ul>\n<li>\n<p>\u5408\u5e76\u8fdc\u7a0b\u5206\u652f\u5230\u5f53\u524d\u5206\u652f&#xff08;\u4fdd\u7559\u5408\u5e76\u8bb0\u5f55&#xff09;<\/p>\n<\/li>\n<\/ul>\n<h3>5. \u56e2\u961f\u534f\u4f5c<\/h3>\n<p>&#xff08;1&#xff09;git fetch\u200c<\/p>\n<ul>\n<li>\n<p>\u66f4\u65b0\u672c\u5730\u8ddf\u8e2a\u7684\u8fdc\u7a0b\u5206\u652f\u4fe1\u606f&#xff08;\u4e0d\u81ea\u52a8\u5408\u5e76&#xff09;<\/p>\n<\/li>\n<\/ul>\n<p>&#xff08;\u200c2&#xff09;git log &#8211;graph\u200c<\/p>\n<ul>\n<li>\n<p>\u67e5\u770b\u5206\u652f\u5408\u5e76\u5386\u53f2&#xff08;\u8f85\u52a9\u56e2\u961f\u534f\u4f5c\u6392\u67e5\u95ee\u9898&#xff09;<\/p>\n<\/li>\n<\/ul>\n<h3>6. \u6ce8\u610f\u4e8b\u9879<\/h3>\n<ul>\n<li>\n<p>\u786e\u4fdd\u4f7f\u7528\u516c\u53f8\u7f51\u7edc\u73af\u5883\u53ef\u8bbf\u95ee\u4ed3\u5e93<\/p>\n<\/li>\n<li>\n<p>\u907f\u514d\u5728\u516c\u5171\u5206\u652f\u6267\u884c rebase \u64cd\u4f5c&#xff08;\u53ef\u80fd\u7834\u574f\u4ed6\u4eba\u63d0\u4ea4\u5386\u53f2&#xff09;<\/p>\n<\/li>\n<li>\n<p>\u5b9a\u671f\u4f7f\u7528 git fetch \u66f4\u65b0\u8fdc\u7a0b\u8ddf\u8e2a\u5206\u652f\u4fe1\u606f<\/p>\n<\/li>\n<\/ul>\n<h2>\u4e8c\u3001\u5e38\u7528\u6f14\u793a\u793a\u4f8b<\/h2>\n<ul>\n<li>\n<p>\u201c\u5f20\u4e09\u201d\u5728\u67d0\u516c\u53f8\u7684\u516c\u5171\u4ee3\u7801\u4ed3\u5e93\u4e2d\u8fdb\u884c\u9879\u76ee\u7684\u5f00\u53d1&#xff0c;\u8be5\u4ed3\u5e93\u7684\u4e3b\u5206\u652f&#xff08;\u4e3b\u5e72&#xff09;\u5047\u8bbe\u4e3a\u201cmaster\u201d&#xff1a;<\/p>\n<\/li>\n<\/ul>\n<p># \u82e5\u662f\u7b2c\u4e00\u6b21\u5f00\u53d1&#xff0c;\u5219\u9700\u4ece\u4ed3\u5e93\u4e2d\u514b\u9686\u4ee3\u7801\u5230\u672c\u5730<br \/>\ngit clone git&#064;git.abcd.ef:gh\/test.git<br \/>\n# git&#064;git.abcd.ef:gh\/test.git \u4e3a\u4ed3\u5e93\u7684 URL<\/p>\n<p># \u4ed3\u5e93\u4e3a\u516c\u5171\u4ed3\u5e93&#xff0c;\u6545\u9700\u8981\u521b\u5efa\u81ea\u5df1\u7684\u5f00\u53d1\u5206\u652f&#xff0c;\u4e0d\u53ef\u5728\u4e3b\u5206\u652f master \u8fdb\u884c\u5f00\u53d1<br \/>\ngit checkout -b zhangsan<br \/>\n# \u628a\u81ea\u5df1\u672c\u5730\u7684\u5206\u652f\u63a8\u9001\u5230\u8fdc\u7a0b\u4ed3\u5e93<br \/>\ngit push origin zhangsan<\/p>\n<p># \u67e5\u770b\u5f53\u524d\u4ed3\u5e93\u7684\u6240\u6709\u5206\u652f(\u672c\u5730\u7684)<br \/>\ngit branch<br \/>\n# \u5207\u6362\u5230\u5176\u4ed6\u7684\u5206\u652f&#xff0c;\u5047\u8bbe\u672c\u5730\u6709\u53e6\u4e00\u4e2a\u5206\u652f zhangsan01<br \/>\ngit checkout zhangsan01<\/p>\n<p># \u82e5\u975e\u7b2c\u4e00\u6b21\u5f00\u53d1&#xff0c;\u5373\u4e4b\u524d\u5df2\u7ecf\u5c06\u4ee3\u7801\u514b\u9686\u5230\u672c\u5730\u4e86&#xff0c;\u9700\u8981\u5728\u5f00\u53d1\u524d\u62c9\u53d6\u4ed3\u5e93\u7684\u6700\u65b0\u4ee3\u7801&#xff0c;\u65b9\u53ef\u8fdb\u884c\u5f00\u53d1(\u56e0\u4e3a\u516c\u5171\u4ed3\u5e93\u5b58\u5728\u5df2\u7ecf\u6709\u4eba\u63d0\u4ea4\u8fc7\u6700\u65b0\u4ee3\u7801\u7684\u53ef\u80fd\u6027)<br \/>\ngit pull<br \/>\ngit pull origin master<br \/>\n# \u4ee5\u4e0a\u4e24\u4e2a\u547d\u4ee4\u770b\u60c5\u51b5\u4f7f\u7528&#xff0c;\u5224\u65ad\u6709\u65e0\u8ddf\u8e2a\u5173\u7cfb<\/p>\n<p># \u5b8c\u6210\u4ee3\u7801\u5f00\u53d1\u540e&#xff0c;\u63d0\u4ea4\u4e4b\u524d\u8fdb\u884c\u68c0\u67e5<br \/>\ngit status<br \/>\ngit diff [\u6587\u4ef6\u540d]<\/p>\n<p># \u68c0\u67e5\u65e0\u8bef\u540e&#xff0c;\u518d\u8fdb\u884c\u6682\u5b58(\u5efa\u8bae\u6587\u4ef6\u9700\u8981\u9010\u4e2a\u68c0\u67e5&#xff0c;\u9010\u4e2a\u6682\u5b58&#xff0c;\u4e0d\u5efa\u8bae\u6279\u91cf)<br \/>\ngit add [\u6587\u4ef6\u540d]<\/p>\n<p># \u5b8c\u6210\u6240\u6709\u4fee\u6539\u6587\u4ef6\u7684\u6682\u5b58\u540e&#xff0c;\u65b9\u53ef\u8fdb\u884c\u63d0\u4ea4<br \/>\ngit commit -m [zhangsan coding]<\/p>\n<p># \u6700\u540e\u63a8\u9001\u5230\u8fdc\u7a0b\u7684\u81ea\u5df1\u7684\u5206\u652f<br \/>\ngit push -u origin zhangsan<br \/>\n# \u6700\u540e\u518d gitlab \u4e0a\u68c0\u67e5\u5b8c\u540e&#xff0c;\u53d1\u9001 merge \u8bf7\u6c42(\u82e5\u65e0\u6743\u9650\u5ba1\u6279\u8be5\u8bf7\u6c42&#xff0c;\u627e\u6709\u6743\u9650\u7684\u4eba\u5373\u53ef)<\/p>\n<ul>\n<li>\n<p>\u4e0a\u8ff0\u7ecf\u5386\u6839\u636e\u4e2a\u4eba\u7ecf\u5386\u800c\u8a00&#xff0c;\u4ec5\u4f9b\u53c2\u8003<\/p>\n<\/li>\n<\/ul>\n<h2>\u4e09\u3001\u8865\u5145 &#8211; rebase \u60c5\u51b5<\/h2>\n<ul>\n<li>\n<p>\u9996\u5148\u8981\u6ce8\u610f\u4f7f\u7528 rebase \u7684\u573a\u666f&#xff1a;\u672a\u5171\u4eab\u7ed9\u4ed6\u4eba\u7684\u4e2a\u4eba\u5206\u652f<\/p>\n<\/li>\n<li>\n<p>\u5728\u4e3a\u671f\u8f83\u957f\u65f6\u95f4\u7684\u4ee3\u7801\u5f00\u53d1\u8fc7\u7a0b&#xff0c;\u6bcf\u5929\u5f00\u53d1\u524d\u4f7f\u7528\u4e00\u904d rebase \u53ef\u8ba9\u5408\u5e76\u7b80\u5355\u5316<\/p>\n<\/li>\n<li>\n<p>\u5efa\u8bae&#xff1a;\u5728\u6700\u540e\u5408\u5e76 CI \u4e4b\u524d&#xff0c;\u518d\u8fdb\u884c\u4e00\u904d rebase<\/p>\n<\/li>\n<\/ul>\n<h3>1. \u4e2a\u4eba\u5206\u652f<\/h3>\n<ul>\n<li>\n<p>\u76ee\u7684&#xff1a;\u4fdd\u6301\u5206\u652f zhangsan \u4e0e\u4e3b\u5206\u652f master \u540c\u6b65&#xff0c;\u907f\u514d\u6700\u7ec8\u5408\u5e76\u65f6\u51b2\u7a81<\/p>\n<\/li>\n<\/ul>\n<p># \u6bcf\u5929\u5f00\u59cb\u5de5\u4f5c\u524d&#xff1a;<br \/>\ngit checkout master<br \/>\ngit pull origin master          # \u62c9\u53d6\u6700\u65b0\u4ee3\u7801<br \/>\ngit checkout zhangsan<br \/>\ngit rebase master               # \u5c06\u672c\u5730\u63d0\u4ea4\u201c\u79fb\u52a8\u201d\u5230\u6700\u65b0 master \u4e0a<\/p>\n<h3>2. \u6574\u7406\u63d0\u4ea4\u5386\u53f2<\/h3>\n<ul>\n<li>\n<p>\u5982\u679c\u00a0zhangsan\u00a0\u5206\u652f\u4e0a\u6709\u5927\u91cf\u7410\u788e\u63d0\u4ea4&#xff08;\u5982\u201cfix typo\u201d\u7b49&#xff09;&#xff0c;\u53ef\u4ee5\u901a\u8fc7\u4ea4\u4e92\u5f0f rebase \u6574\u7406<\/p>\n<\/li>\n<\/ul>\n<p># \u5408\u5e76\/\u7f16\u8f91\u63d0\u4ea4<br \/>\ngit rebase -i master<\/p>\n<p>\u00a0<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb578\u6b21\uff0c\u70b9\u8d5e16\u6b21\uff0c\u6536\u85cf9\u6b21\u3002\u672c\u6587\u4ecb\u7ecd\u4e86GitLab\u9879\u76ee\u5f00\u53d1\u4e2d\u5e38\u7528\u7684Git\u547d\u4ee4\u548c\u64cd\u4f5c\u6d41\u7a0b\u3002\u4e3b\u8981\u5305\u542b\uff1a1\uff09\u57fa\u7840\u64cd\u4f5c\uff08\u514b\u9686\u3001\u62c9\u53d6\u3001\u5206\u652f\u7ba1\u7406\uff09\uff1b2\uff09\u4ee3\u7801\u7ba1\u7406\uff08\u63d0\u4ea4\u3001\u63a8\u9001\u3001\u65e5\u5fd7\u67e5\u770b\uff09\uff1b3\uff09\u51b2\u7a81\u5904\u7406\uff08rebase\u4e0emerge\uff09\uff1b4\uff09\u56e2\u961f\u534f\u4f5c\u6ce8\u610f\u4e8b\u9879\u3002\u91cd\u70b9\u6f14\u793a\u4e86\u4e2a\u4eba\u5f00\u53d1\u5206\u652f\u7684\u6807\u51c6\u6d41\u7a0b\uff1a\u514b\u9686\u4ed3\u5e93\u2192\u521b\u5efa\u5f00\u53d1\u5206\u652f\u2192\u65e5\u5e38\u5f00\u53d1\u2192\u63d0\u4ea4\u524d\u68c0\u67e5\u2192\u63a8\u9001\u4e2a\u4eba\u5206\u652f\u2192\u53d1\u8d77\u5408\u5e76\u8bf7\u6c42\u3002\u7279\u522b\u5f3a\u8c03rebase\u7684\u4f7f\u7528\u573a\u666f\u548c\u6ce8\u610f\u4e8b\u9879\uff0c\u5efa\u8bae\u4ec5\u5728\u672a\u5171\u4eab\u7684\u4e2a\u4eba\u5206\u652f\u4f7f\u7528\uff0c\u5e76\u5728\u6bcf\u65e5\u5f00\u53d1\u524d\u6267\u884crebase\u4ee5\u4fdd\u6301\u4e0e\u4e3b\u5206\u652f\u540c\u6b65\u3002\u540c\u65f6\u63d0\u9192\u907f\u514d\u5728\u516c\u5171\u5206\u652f\u6267\u884crebase\uff0c\u5b9a\u671f\u4f7f\u7528git fetch\u66f4\u65b0\u8fdc<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[89,273,4903],"topic":[],"class_list":["post-50304","post","type-post","status-publish","format-standard","hentry","category-server","tag-git","tag-gitlab","tag-4903"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>GitLab \u4ed3\u5e93 \u2014 \u5e38\u7528\u7684 git \u547d\u4ee4 - \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\/50304.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"GitLab \u4ed3\u5e93 \u2014 \u5e38\u7528\u7684 git \u547d\u4ee4 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb578\u6b21\uff0c\u70b9\u8d5e16\u6b21\uff0c\u6536\u85cf9\u6b21\u3002\u672c\u6587\u4ecb\u7ecd\u4e86GitLab\u9879\u76ee\u5f00\u53d1\u4e2d\u5e38\u7528\u7684Git\u547d\u4ee4\u548c\u64cd\u4f5c\u6d41\u7a0b\u3002\u4e3b\u8981\u5305\u542b\uff1a1\uff09\u57fa\u7840\u64cd\u4f5c\uff08\u514b\u9686\u3001\u62c9\u53d6\u3001\u5206\u652f\u7ba1\u7406\uff09\uff1b2\uff09\u4ee3\u7801\u7ba1\u7406\uff08\u63d0\u4ea4\u3001\u63a8\u9001\u3001\u65e5\u5fd7\u67e5\u770b\uff09\uff1b3\uff09\u51b2\u7a81\u5904\u7406\uff08rebase\u4e0emerge\uff09\uff1b4\uff09\u56e2\u961f\u534f\u4f5c\u6ce8\u610f\u4e8b\u9879\u3002\u91cd\u70b9\u6f14\u793a\u4e86\u4e2a\u4eba\u5f00\u53d1\u5206\u652f\u7684\u6807\u51c6\u6d41\u7a0b\uff1a\u514b\u9686\u4ed3\u5e93\u2192\u521b\u5efa\u5f00\u53d1\u5206\u652f\u2192\u65e5\u5e38\u5f00\u53d1\u2192\u63d0\u4ea4\u524d\u68c0\u67e5\u2192\u63a8\u9001\u4e2a\u4eba\u5206\u652f\u2192\u53d1\u8d77\u5408\u5e76\u8bf7\u6c42\u3002\u7279\u522b\u5f3a\u8c03rebase\u7684\u4f7f\u7528\u573a\u666f\u548c\u6ce8\u610f\u4e8b\u9879\uff0c\u5efa\u8bae\u4ec5\u5728\u672a\u5171\u4eab\u7684\u4e2a\u4eba\u5206\u652f\u4f7f\u7528\uff0c\u5e76\u5728\u6bcf\u65e5\u5f00\u53d1\u524d\u6267\u884crebase\u4ee5\u4fdd\u6301\u4e0e\u4e3b\u5206\u652f\u540c\u6b65\u3002\u540c\u65f6\u63d0\u9192\u907f\u514d\u5728\u516c\u5171\u5206\u652f\u6267\u884crebase\uff0c\u5b9a\u671f\u4f7f\u7528git fetch\u66f4\u65b0\u8fdc\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/50304.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-07-30T14:51:42+00:00\" \/>\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=\"1 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/50304.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/50304.html\",\"name\":\"GitLab \u4ed3\u5e93 \u2014 \u5e38\u7528\u7684 git \u547d\u4ee4 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-07-30T14:51:42+00:00\",\"dateModified\":\"2025-07-30T14:51:42+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/50304.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/50304.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/50304.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"GitLab \u4ed3\u5e93 \u2014 \u5e38\u7528\u7684 git \u547d\u4ee4\"}]},{\"@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":"GitLab \u4ed3\u5e93 \u2014 \u5e38\u7528\u7684 git \u547d\u4ee4 - \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\/50304.html","og_locale":"zh_CN","og_type":"article","og_title":"GitLab \u4ed3\u5e93 \u2014 \u5e38\u7528\u7684 git \u547d\u4ee4 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb578\u6b21\uff0c\u70b9\u8d5e16\u6b21\uff0c\u6536\u85cf9\u6b21\u3002\u672c\u6587\u4ecb\u7ecd\u4e86GitLab\u9879\u76ee\u5f00\u53d1\u4e2d\u5e38\u7528\u7684Git\u547d\u4ee4\u548c\u64cd\u4f5c\u6d41\u7a0b\u3002\u4e3b\u8981\u5305\u542b\uff1a1\uff09\u57fa\u7840\u64cd\u4f5c\uff08\u514b\u9686\u3001\u62c9\u53d6\u3001\u5206\u652f\u7ba1\u7406\uff09\uff1b2\uff09\u4ee3\u7801\u7ba1\u7406\uff08\u63d0\u4ea4\u3001\u63a8\u9001\u3001\u65e5\u5fd7\u67e5\u770b\uff09\uff1b3\uff09\u51b2\u7a81\u5904\u7406\uff08rebase\u4e0emerge\uff09\uff1b4\uff09\u56e2\u961f\u534f\u4f5c\u6ce8\u610f\u4e8b\u9879\u3002\u91cd\u70b9\u6f14\u793a\u4e86\u4e2a\u4eba\u5f00\u53d1\u5206\u652f\u7684\u6807\u51c6\u6d41\u7a0b\uff1a\u514b\u9686\u4ed3\u5e93\u2192\u521b\u5efa\u5f00\u53d1\u5206\u652f\u2192\u65e5\u5e38\u5f00\u53d1\u2192\u63d0\u4ea4\u524d\u68c0\u67e5\u2192\u63a8\u9001\u4e2a\u4eba\u5206\u652f\u2192\u53d1\u8d77\u5408\u5e76\u8bf7\u6c42\u3002\u7279\u522b\u5f3a\u8c03rebase\u7684\u4f7f\u7528\u573a\u666f\u548c\u6ce8\u610f\u4e8b\u9879\uff0c\u5efa\u8bae\u4ec5\u5728\u672a\u5171\u4eab\u7684\u4e2a\u4eba\u5206\u652f\u4f7f\u7528\uff0c\u5e76\u5728\u6bcf\u65e5\u5f00\u53d1\u524d\u6267\u884crebase\u4ee5\u4fdd\u6301\u4e0e\u4e3b\u5206\u652f\u540c\u6b65\u3002\u540c\u65f6\u63d0\u9192\u907f\u514d\u5728\u516c\u5171\u5206\u652f\u6267\u884crebase\uff0c\u5b9a\u671f\u4f7f\u7528git fetch\u66f4\u65b0\u8fdc","og_url":"https:\/\/www.wsisp.com\/helps\/50304.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-07-30T14:51:42+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/50304.html","url":"https:\/\/www.wsisp.com\/helps\/50304.html","name":"GitLab \u4ed3\u5e93 \u2014 \u5e38\u7528\u7684 git \u547d\u4ee4 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-07-30T14:51:42+00:00","dateModified":"2025-07-30T14:51:42+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/50304.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/50304.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/50304.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"GitLab \u4ed3\u5e93 \u2014 \u5e38\u7528\u7684 git \u547d\u4ee4"}]},{"@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\/50304","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=50304"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/50304\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=50304"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=50304"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=50304"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=50304"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}