{"id":87192,"date":"2020-04-30T01:05:16","date_gmt":"2020-04-29T17:05:16","guid":{"rendered":"http:\/\/4563.org\/?p=87192"},"modified":"2020-04-30T01:05:16","modified_gmt":"2020-04-29T17:05:16","slug":"%e5%90%84%e4%bd%8d-git-%e5%a4%a7%e4%bd%ac%ef%bc%8c%e8%af%b7%e6%95%99%e4%b8%80%e4%b8%aa%e9%97%ae%e9%a2%98","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=87192","title":{"rendered":"\u5404\u4f4d Git \u5927\u4f6c\uff0c\u8bf7\u6559\u4e00\u4e2a\u95ee\u9898"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u5404\u4f4d Git \u5927\u4f6c\uff0c\u8bf7\u6559\u4e00\u4e2a\u95ee\u9898               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : dingyaguang117 <\/span>  <span><i><\/i> 10<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\">                        \u5f04\u4e86\u4e2a\u81ea\u52a8\u90e8\u7f72\u7684\u811a\u672c\uff0c\u73b0\u5728\u6709\u4e2a\u95ee\u9898\u60f3\u8bf7\u6559\u4e00\u4e0b git \u5927\u4f6c<\/p>\n<p>\u7b80\u5355\u6765\u8bb2\u5c31\u662f\u9700\u8981\uff1a\u5207\u6362\u5230\u6307\u5b9a\u5206\u652f\u7684\u6700\u65b0 commit\uff0c\u4f46\u662f\u9700\u8981\u8003\u8651\u5230\u4e0b\u9762\u7684\u51e0\u79cd\u60c5\u51b5<\/p>\n<p>\uff08\u5047\u8bbe\u9700\u8981\u5207\u6362\u5230 test \u5206\u652f\uff09<\/p>\n<p>1. \u672c\u5730\u6ca1\u6709 test \u5206\u652f<br \/>2. \u5f53\u524d\u5206\u652f\u6709\u672a\u63d0\u4ea4\u7684\u6539\u52a8\uff08\u53ef\u4ee5\u76f4\u63a5 reset \u64cd\u4f5c\uff09<br \/>3. \u672c\u5730\u6709 test \u5206\u652f\uff0c\u4f46\u662f\u4e0d\u662f\u6700\u65b0<br \/>4. \u5f53\u524d\u5206\u652f\u53ef\u80fd\u5df2\u7ecf\u5728 test \u6216\u8005\u4e0d\u5728<\/p>\n<p>\u8bd5\u9a8c\u8fc7\u4e0b\u9762\u811a\u672c<\/p>\n<p>&#8220;`<br \/>git reset &#8211;hard;<br \/>git fetch -u origin test:test;<br \/>git checkout test;<br \/>&#8220;`<\/p>\n<p>\u4f1a\u6709\u95ee\u9898\uff08\u672c\u5730\u4f1a\u51fa\u73b0\u5f88\u591a modifed \u72b6\u6001\u7684\u6587\u4ef6\uff09\uff0c\u8bf7\u6559\u4e0a\u9762\u7684\u811a\u672c\u4e3a\u5565\u4f1a\u6709\u95ee\u9898      <\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>4<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"1370053\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : yukiloh <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u7ed1\u5b9a\uff0c\u987a\u4fbf\u95ee\u4e00\u4e2a\u6211\u81ea\u5df1\u9047\u5230\u7684\u95ee\u9898<br \/>master \u7528\u4e8e\u516c\u5171\u5c55\u793a<br \/>dev \u5206\u652f\u7528\u4e8e\u5f00\u53d1\uff0c\u4f46\u662f dev \u4f1a\u6709\u5f88\u591a\u7410\u788e\u7684\u5f00\u53d1\u6587\u4ef6\uff0c\u6bcf\u6b21\u5b8c\u6210\u5c0f\u9636\u6bb5\u63d0\u4ea4\u5230 master \u524d\u90fd\u8981\u624b\u52a8\u6e05\u7406\u4e00\u4e0b\uff0c\u6709\u5565\u597d\u65b9\u6848\u5417\uff0c\u96be\u9053\u662f.ign \u6765\u5199\u89c4\u5219                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1370054\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : dingyaguang117 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u521a\u624d\u53c8\u91cd\u65b0\u6d4b\u8bd5\u4e86\u4e00\u4e0b, \u95ee\u9898\u51fa\u73b0\u5728\u4e0b\u9762\u4e00\u884c\uff1a<\/p>\n<p>git fetch -u origin test:test;<\/p>\n<p>\u5982\u679c\u5f53\u524d\u5206\u652f\u5df2\u7ecf\u662f test\uff0c\u4f1a\u66f4\u65b0 test \u5206\u652f\u6307\u5411\u6700\u65b0 commit\uff0c \u4f46\u662f\u4e0d\u4f1a\u66f4\u65b0\u672c\u5730\u5de5\u4f5c\u533a\uff0c\u6240\u4ee5\u672c\u5730\u7684\u51fa\u73b0\u5f88\u591a modified \u72b6\u6001\u7684\u6587\u4ef6\uff1b<\/p>\n<p>\u8fd9\u65f6\u5019\u518d git reset &#8211;hard \u4e00\u6b21\u5c31\u597d\u4e86\u3002<\/p>\n<p>\u66f4\u65b0\u4e86\u4e00\u4e0b\uff0c\u4e0b\u9762\u7684\u811a\u672c\u5e94\u8be5\u80fd\u6ee1\u8db3\u4e0a\u8ff0 4 \u79cd\u60c5\u51b5\uff0c\u65e0\u8bba\u5f53\u524d\u5728\u54ea\u4e2a\u5206\u652f\uff0c\u662f\u5426\u6709\u6539\u52a8\uff0c\u672c\u5730 test \u5206\u652f\u662f\u5426\u5b58\u5728\uff0c\u90fd\u53ef\u4ee5\u5207\u6362\u5230\u6700\u65b0\u7684 test \u5206\u652f<\/p>\n<p>&#8220;`<br \/>git reset &#8211;hard;<br \/>git fetch -u origin test:test;<br \/>git checkout test;<br \/>git reset &#8211;hard;<br \/>&#8220;`                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1370055\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : dingyaguang117 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @yukiloh \u6216\u8005\u4f60\u7528\u4e00\u4e2a GUI \u7ba1\u7406\u5de5\u5177\uff0c\u6bcf\u6b21\u53ea\u628a\u4ee3\u7801\u6587\u4ef6 add \u5230 stage\uff0c\u4e5f\u5c31\u662f\u8fc7\u5b8c\u4ee3\u7801\u62d6\u4e00\u4e0b\u7684\u4e8b\u60c5                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1370056\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : billlee <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u770b\u5404\u4e2a CI \u5e73\u53f0\u6784\u5efa\u7684\u65f6\u5019\u4e00\u822c\u90fd\u662f detached head \u72b6\u6001\uff0c\u5982\u679c\u6211\u6765\u5199\u5927\u6982\u4f1a\u8fd9\u6837\u5427\uff1a<\/p>\n<p>&#8220;`<br \/>git fetch<br \/>git checkout &#8211;force $(git rev-parse origin\/test)<br \/>git clean -f -d<br \/>&#8220;`                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u5404\u4f4d Git \u5927\u4f6c\uff0c\u8bf7\u6559\u4e00\u4e2a\u95ee\u9898 &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/87192"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=87192"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/87192\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=87192"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=87192"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=87192"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}