{"id":7604,"date":"2015-11-22T23:55:23","date_gmt":"2015-11-22T15:55:23","guid":{"rendered":"http:\/\/jpuyy.com\/?p=7604"},"modified":"2019-11-11T13:32:02","modified_gmt":"2019-11-11T05:32:02","slug":"git-%e5%8e%8b%e7%bc%a9%e6%8f%90%e4%ba%a4","status":"publish","type":"post","link":"https:\/\/jpuyy.com\/?p=7604","title":{"rendered":"git \u538b\u7f29\u63d0\u4ea4 squash merge"},"content":{"rendered":"<p>\u5206\u652f\u91cc\u591a\u6b21\u63d0\u4ea4\u5408\u5e76\u6210\u4e00\u4e2a\u63d0\u4ea4<\/p>\n<p>\u793a\u4f8b<\/p>\n<p>\u5c06\u6700\u8fd1\u51e0\u4e2a(number_of_commits) \u63d0\u4ea4\u5408\u5e76\u6210\u4e00\u4e2a\u63d0\u4ea4<\/p>\n<pre>git rebase -i HEAD~[number_of_commits]<\/pre>\n<p>\u7136\u540e\u8fdb\u5165\u4ea4\u4e92\u5f0f\u9009\u62e9<\/p>\n<pre>#\n# Commands:\n# p, pick = use commit\n# r, reword = use commit, but edit the commit message\n# e, edit = use commit, but stop for amending\n# s, squash = use commit, but meld into previous commit\n# f, fixup = like \"squash\", but discard this commit's log message\n# x, exec = run command (the rest of the line) using shell\n#\n# These lines can be re-ordered; they are executed from top to bottom. #\n# If you remove a line here THAT COMMIT WILL BE LOST.\n#\n# However, if you remove everything, the rebase will be aborted.\n#\n# Note that empty commits are commented out\n\n<\/pre>\n<p>\u8fd9\u91cc\u5148\u8fdb\u884c commit \u65b9\u9762\u7684\u9009\u62e9\uff0c\u628a\u9664\u53bb\u7b2c\u4e00\u884c\u7684\u90fd\u6539\u4e3a squash<\/p>\n<pre>pick f7f3f6d changed my name a bit\nsquash 310154e updated README formatting and added blame\nsquash a5f4a0d added cat-file\n<\/pre>\n<p>\u7136\u540e\u8fdb\u884c commit msg \u7684\u754c\u9762\uff0c\u81ea\u5df1\u5199\u4e00\u4e0b\u5408\u5e76\u540e\u7684 commit\u3002<\/p>\n<p>\u5206\u652f\u7684 push \u5f3a\u5236\u63d0\u4ea4\u4f1a\u5c06\u672c\u5730\u64cd\u4f5c\u751f\u6548<\/p>\n<p>\u53c2\u8003:<\/p>\n<p>pro git<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5206\u652f\u91cc\u591a\u6b21\u63d0\u4ea4\u5408\u5e76\u6210\u4e00\u4e2a\u63d0\u4ea4 \u793a\u4f8b \u5c06\u6700\u8fd1\u51e0\u4e2a(number_of_commits) \u63d0\u4ea4\u5408\u5e76\u6210\u4e00\u4e2a\u63d0\u4ea4 git rebase -i HEAD~[number_of_commits] \u7136\u540e\u8fdb\u5165\u4ea4\u4e92\u5f0f\u9009\u62e9 # # Commands: # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash = use commit, but meld into previous commit # f, fixup = like [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[168],"tags":[],"class_list":["post-7604","post","type-post","status-publish","format-standard","hentry","category-git"],"_links":{"self":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/7604","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7604"}],"version-history":[{"count":5,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/7604\/revisions"}],"predecessor-version":[{"id":8641,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/7604\/revisions\/8641"}],"wp:attachment":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7604"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7604"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7604"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}