{"id":5224,"date":"2018-08-22T12:17:20","date_gmt":"2018-08-22T12:17:20","guid":{"rendered":"http:\/\/www.scmgalaxy.com\/tutorials\/?p=5224"},"modified":"2021-02-27T09:07:01","modified_gmt":"2021-02-27T09:07:01","slug":"how-to-replace-changes-after-the-gerrit-review-without-changing-the-commit-id","status":"publish","type":"post","link":"https:\/\/www.scmgalaxy.com\/tutorials\/how-to-replace-changes-after-the-gerrit-review-without-changing-the-commit-id\/","title":{"rendered":"How to replace Changes after the Gerrit review without changing the commit id?"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5291\" src=\"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2018\/08\/gerrit-5.png\" alt=\"\" width=\"600\" height=\"350\" srcset=\"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2018\/08\/gerrit-5.png 600w, https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2018\/08\/gerrit-5-300x175.png 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<p><strong>How to replace Changes after the Gerrit review without changing the commit id?<\/strong><\/p>\n<p>One of the main benefits of code review is the ability to receive and incorporate feedback from other developers without changing the commit-id and review id. With Gerrit, you incorporate these changes by amending the commit. Gerrit uses the CHange-Id to ensure that each iteration of the commit are stored together as patchsets.<\/p>\n<p>The process of modify same commit and commit message on gerrit after patchset creation is pretty straight forward.<\/p>\n<p><strong>Step 1 &#8211; Do the required modification in the code based on the review.<\/strong><\/p>\n<p><strong>Step 2 &#8211; Add files using git add commands.<\/strong><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">$ git add filename<\/pre>\n<p><strong>Step 3 &#8211; Command to update\/amend the most recent commit.<\/strong><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">$ git commit --amend<\/pre>\n<p>When amending a commit with git commit &#8211;amend, leave the Change-Id line unmodified in the commit message. This will allow Gerrit to automatically update the change with the amended commit.<\/p>\n<p><strong>Step 4 &#8211; Gerrit updates the commit under review with your latest changes.<\/strong><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">$ git push origin HEAD:refs\/for\/master\r\n$ git push origin HEAD:refs\/for\/&#x5B;BRANCH_NAME]<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>How to replace Changes after the Gerrit review without changing the commit id? One of the main benefits of code [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":5291,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[4994],"tags":[5024,1964,5023,945,5025,5020,5019,5026],"class_list":["post-5224","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-gerrit","tag-amend","tag-changes","tag-commit","tag-gerrit","tag-git-add","tag-git-commit","tag-git-push","tag-patchset"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to replace Changes after the Gerrit review without changing the commit id? - scmGalaxy<\/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.scmgalaxy.com\/tutorials\/how-to-replace-changes-after-the-gerrit-review-without-changing-the-commit-id\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to replace Changes after the Gerrit review without changing the commit id? - scmGalaxy\" \/>\n<meta property=\"og:description\" content=\"How to replace Changes after the Gerrit review without changing the commit id? One of the main benefits of code [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.scmgalaxy.com\/tutorials\/how-to-replace-changes-after-the-gerrit-review-without-changing-the-commit-id\/\" \/>\n<meta property=\"og:site_name\" content=\"scmGalaxy\" \/>\n<meta property=\"article:published_time\" content=\"2018-08-22T12:17:20+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-02-27T09:07:01+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2018\/08\/gerrit-5.png\" \/>\n\t<meta property=\"og:image:width\" content=\"600\" \/>\n\t<meta property=\"og:image:height\" content=\"350\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"scmgalaxy K\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"scmgalaxy K\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/how-to-replace-changes-after-the-gerrit-review-without-changing-the-commit-id\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/how-to-replace-changes-after-the-gerrit-review-without-changing-the-commit-id\\\/\"},\"author\":{\"name\":\"scmgalaxy K\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/fc12ad190f540e79460243c81148d102\"},\"headline\":\"How to replace Changes after the Gerrit review without changing the commit id?\",\"datePublished\":\"2018-08-22T12:17:20+00:00\",\"dateModified\":\"2021-02-27T09:07:01+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/how-to-replace-changes-after-the-gerrit-review-without-changing-the-commit-id\\\/\"},\"wordCount\":197,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/how-to-replace-changes-after-the-gerrit-review-without-changing-the-commit-id\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2018\\\/08\\\/gerrit-5.png\",\"keywords\":[\"amend\",\"Changes\",\"commit\",\"Gerrit\",\"git add\",\"git commit\",\"git push\",\"patchset\"],\"articleSection\":[\"Gerrit\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/how-to-replace-changes-after-the-gerrit-review-without-changing-the-commit-id\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/how-to-replace-changes-after-the-gerrit-review-without-changing-the-commit-id\\\/\",\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/how-to-replace-changes-after-the-gerrit-review-without-changing-the-commit-id\\\/\",\"name\":\"How to replace Changes after the Gerrit review without changing the commit id? - scmGalaxy\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/how-to-replace-changes-after-the-gerrit-review-without-changing-the-commit-id\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/how-to-replace-changes-after-the-gerrit-review-without-changing-the-commit-id\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2018\\\/08\\\/gerrit-5.png\",\"datePublished\":\"2018-08-22T12:17:20+00:00\",\"dateModified\":\"2021-02-27T09:07:01+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/fc12ad190f540e79460243c81148d102\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/how-to-replace-changes-after-the-gerrit-review-without-changing-the-commit-id\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/how-to-replace-changes-after-the-gerrit-review-without-changing-the-commit-id\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/how-to-replace-changes-after-the-gerrit-review-without-changing-the-commit-id\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2018\\\/08\\\/gerrit-5.png\",\"contentUrl\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2018\\\/08\\\/gerrit-5.png\",\"width\":600,\"height\":350},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/how-to-replace-changes-after-the-gerrit-review-without-changing-the-commit-id\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to replace Changes after the Gerrit review without changing the commit id?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#website\",\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/\",\"name\":\"scmGalaxy\",\"description\":\"A Platform for Software Engineers\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/fc12ad190f540e79460243c81148d102\",\"name\":\"scmgalaxy K\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b902ea8c77ee0a326c112f29d0edf51b7c3e1cd05c4fb92a810177e9c3f12a9?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b902ea8c77ee0a326c112f29d0edf51b7c3e1cd05c4fb92a810177e9c3f12a9?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b902ea8c77ee0a326c112f29d0edf51b7c3e1cd05c4fb92a810177e9c3f12a9?s=96&d=mm&r=g\",\"caption\":\"scmgalaxy K\"},\"sameAs\":[\"http:\\\/\\\/www.DevOpsSchool.com\"],\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/author\\\/scmgalaxy\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to replace Changes after the Gerrit review without changing the commit id? - scmGalaxy","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.scmgalaxy.com\/tutorials\/how-to-replace-changes-after-the-gerrit-review-without-changing-the-commit-id\/","og_locale":"en_US","og_type":"article","og_title":"How to replace Changes after the Gerrit review without changing the commit id? - scmGalaxy","og_description":"How to replace Changes after the Gerrit review without changing the commit id? One of the main benefits of code [&hellip;]","og_url":"https:\/\/www.scmgalaxy.com\/tutorials\/how-to-replace-changes-after-the-gerrit-review-without-changing-the-commit-id\/","og_site_name":"scmGalaxy","article_published_time":"2018-08-22T12:17:20+00:00","article_modified_time":"2021-02-27T09:07:01+00:00","og_image":[{"width":600,"height":350,"url":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2018\/08\/gerrit-5.png","type":"image\/png"}],"author":"scmgalaxy K","twitter_card":"summary_large_image","twitter_misc":{"Written by":"scmgalaxy K","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/how-to-replace-changes-after-the-gerrit-review-without-changing-the-commit-id\/#article","isPartOf":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/how-to-replace-changes-after-the-gerrit-review-without-changing-the-commit-id\/"},"author":{"name":"scmgalaxy K","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/fc12ad190f540e79460243c81148d102"},"headline":"How to replace Changes after the Gerrit review without changing the commit id?","datePublished":"2018-08-22T12:17:20+00:00","dateModified":"2021-02-27T09:07:01+00:00","mainEntityOfPage":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/how-to-replace-changes-after-the-gerrit-review-without-changing-the-commit-id\/"},"wordCount":197,"commentCount":0,"image":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/how-to-replace-changes-after-the-gerrit-review-without-changing-the-commit-id\/#primaryimage"},"thumbnailUrl":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2018\/08\/gerrit-5.png","keywords":["amend","Changes","commit","Gerrit","git add","git commit","git push","patchset"],"articleSection":["Gerrit"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.scmgalaxy.com\/tutorials\/how-to-replace-changes-after-the-gerrit-review-without-changing-the-commit-id\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/how-to-replace-changes-after-the-gerrit-review-without-changing-the-commit-id\/","url":"https:\/\/www.scmgalaxy.com\/tutorials\/how-to-replace-changes-after-the-gerrit-review-without-changing-the-commit-id\/","name":"How to replace Changes after the Gerrit review without changing the commit id? - scmGalaxy","isPartOf":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/how-to-replace-changes-after-the-gerrit-review-without-changing-the-commit-id\/#primaryimage"},"image":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/how-to-replace-changes-after-the-gerrit-review-without-changing-the-commit-id\/#primaryimage"},"thumbnailUrl":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2018\/08\/gerrit-5.png","datePublished":"2018-08-22T12:17:20+00:00","dateModified":"2021-02-27T09:07:01+00:00","author":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/fc12ad190f540e79460243c81148d102"},"breadcrumb":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/how-to-replace-changes-after-the-gerrit-review-without-changing-the-commit-id\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.scmgalaxy.com\/tutorials\/how-to-replace-changes-after-the-gerrit-review-without-changing-the-commit-id\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/how-to-replace-changes-after-the-gerrit-review-without-changing-the-commit-id\/#primaryimage","url":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2018\/08\/gerrit-5.png","contentUrl":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2018\/08\/gerrit-5.png","width":600,"height":350},{"@type":"BreadcrumbList","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/how-to-replace-changes-after-the-gerrit-review-without-changing-the-commit-id\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.scmgalaxy.com\/tutorials\/"},{"@type":"ListItem","position":2,"name":"How to replace Changes after the Gerrit review without changing the commit id?"}]},{"@type":"WebSite","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#website","url":"https:\/\/www.scmgalaxy.com\/tutorials\/","name":"scmGalaxy","description":"A Platform for Software Engineers","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.scmgalaxy.com\/tutorials\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/fc12ad190f540e79460243c81148d102","name":"scmgalaxy K","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/4b902ea8c77ee0a326c112f29d0edf51b7c3e1cd05c4fb92a810177e9c3f12a9?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4b902ea8c77ee0a326c112f29d0edf51b7c3e1cd05c4fb92a810177e9c3f12a9?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4b902ea8c77ee0a326c112f29d0edf51b7c3e1cd05c4fb92a810177e9c3f12a9?s=96&d=mm&r=g","caption":"scmgalaxy K"},"sameAs":["http:\/\/www.DevOpsSchool.com"],"url":"https:\/\/www.scmgalaxy.com\/tutorials\/author\/scmgalaxy\/"}]}},"_links":{"self":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/5224","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/comments?post=5224"}],"version-history":[{"count":3,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/5224\/revisions"}],"predecessor-version":[{"id":5292,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/5224\/revisions\/5292"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/media\/5291"}],"wp:attachment":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/media?parent=5224"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/categories?post=5224"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/tags?post=5224"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}