{"id":490,"date":"2018-12-15T12:08:38","date_gmt":"2018-12-15T05:08:38","guid":{"rendered":"https:\/\/luckytruedev.com\/learning\/?p=490"},"modified":"2019-10-04T06:01:31","modified_gmt":"2019-10-03T23:01:31","slug":"reset-history-commit-repositori-git","status":"publish","type":"post","link":"https:\/\/luckytruedev.com\/learning\/reset-history-commit-repositori-git\/","title":{"rendered":"Reset History Commit Repositori Git"},"content":{"rendered":"\n<p>halo, kali ini gw mau share cara Reset \/ Hapus History Commit pada Repositori di git, pada kasus ini gw pake IDE CLion &amp; Command Line Tools, langsung aja ya.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"640\" src=\"https:\/\/luckytruedev.com\/learning\/wp-content\/uploads\/2018\/12\/Screen-Shot-2018-12-12-at-22.09.50-1024x640.jpg\" alt=\"\" class=\"wp-image-491\" srcset=\"https:\/\/luckytruedev.com\/learning\/wp-content\/uploads\/2018\/12\/Screen-Shot-2018-12-12-at-22.09.50.jpg 1024w, https:\/\/luckytruedev.com\/learning\/wp-content\/uploads\/2018\/12\/Screen-Shot-2018-12-12-at-22.09.50-300x188.jpg 300w, https:\/\/luckytruedev.com\/learning\/wp-content\/uploads\/2018\/12\/Screen-Shot-2018-12-12-at-22.09.50-768x480.jpg 768w, https:\/\/luckytruedev.com\/learning\/wp-content\/uploads\/2018\/12\/Screen-Shot-2018-12-12-at-22.09.50-110x69.jpg 110w, https:\/\/luckytruedev.com\/learning\/wp-content\/uploads\/2018\/12\/Screen-Shot-2018-12-12-at-22.09.50-420x263.jpg 420w, https:\/\/luckytruedev.com\/learning\/wp-content\/uploads\/2018\/12\/Screen-Shot-2018-12-12-at-22.09.50-688x430.jpg 688w, https:\/\/luckytruedev.com\/learning\/wp-content\/uploads\/2018\/12\/Screen-Shot-2018-12-12-at-22.09.50-20x13.jpg 20w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption>Sebelum Reset History Commit<\/figcaption><\/figure><\/div>\n\n\n<div id=\"lucky-4011595807\"><script async src=\"\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js?client=ca-pub-5605825534849002\" crossorigin=\"anonymous\"><\/script><ins class=\"adsbygoogle\" style=\"display:block;\" data-ad-client=\"ca-pub-5605825534849002\" \ndata-ad-slot=\"5317815257\" \ndata-ad-format=\"auto\" data-full-width-responsive=\"true\"><\/ins>\n<script> \n(adsbygoogle = window.adsbygoogle || []).push({}); \n<\/script>\n<\/div>\n\n\n<p>Ini adalah gambar sebelum direset, lalu kita buka IDE (Bebas) untuk kasus ini gw pake IDE CLion buat bikin program C++, lalu kemenu dibagain bawah, pada menu tersebut bernama &#8220;Terminal \/ Command Line&#8221;.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"640\" src=\"https:\/\/luckytruedev.com\/learning\/wp-content\/uploads\/2018\/12\/Screen-Shot-2018-12-12-at-22.14.36-1024x640.jpg\" alt=\"\" class=\"wp-image-492\" srcset=\"https:\/\/luckytruedev.com\/learning\/wp-content\/uploads\/2018\/12\/Screen-Shot-2018-12-12-at-22.14.36.jpg 1024w, https:\/\/luckytruedev.com\/learning\/wp-content\/uploads\/2018\/12\/Screen-Shot-2018-12-12-at-22.14.36-300x188.jpg 300w, https:\/\/luckytruedev.com\/learning\/wp-content\/uploads\/2018\/12\/Screen-Shot-2018-12-12-at-22.14.36-768x480.jpg 768w, https:\/\/luckytruedev.com\/learning\/wp-content\/uploads\/2018\/12\/Screen-Shot-2018-12-12-at-22.14.36-110x69.jpg 110w, https:\/\/luckytruedev.com\/learning\/wp-content\/uploads\/2018\/12\/Screen-Shot-2018-12-12-at-22.14.36-420x263.jpg 420w, https:\/\/luckytruedev.com\/learning\/wp-content\/uploads\/2018\/12\/Screen-Shot-2018-12-12-at-22.14.36-688x430.jpg 688w, https:\/\/luckytruedev.com\/learning\/wp-content\/uploads\/2018\/12\/Screen-Shot-2018-12-12-at-22.14.36-20x13.jpg 20w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption>Reset Commit via Command Line Tools<\/figcaption><\/figure>\n\n\n\n<p>Berikut adalah perintah yang harus di ketikan pada Command Line kalian (entah Terminal, CMD, Android Studio, CLion dll)<br><br>Checkout&nbsp;<br><code>git checkout --orphan latest_branch<\/code><br><br>Menambahkan Semua Files ke git<br><code>git add -A<\/code><br><br>Melakukan Commit &amp; memberikan Pesan commit&nbsp;<br><code>git commit -am \"commit message\"<\/code><br><br>Menghapus Cabang (branch)<br><code>git branch -D master<\/code><br><br>Merubah Nama Cabang (branch) Terakhir ke cabang Master&nbsp;<br><code>git branch -m master<\/code><br><br>Tearkhir Mempaksa Push dan Memperbarui Repositori kalian<br><code>git push -f origin master<\/code><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"640\" src=\"https:\/\/luckytruedev.com\/learning\/wp-content\/uploads\/2018\/12\/Screen-Shot-2018-12-12-at-22.14.48-1024x640.jpg\" alt=\"\" class=\"wp-image-493\" srcset=\"https:\/\/luckytruedev.com\/learning\/wp-content\/uploads\/2018\/12\/Screen-Shot-2018-12-12-at-22.14.48.jpg 1024w, https:\/\/luckytruedev.com\/learning\/wp-content\/uploads\/2018\/12\/Screen-Shot-2018-12-12-at-22.14.48-300x188.jpg 300w, https:\/\/luckytruedev.com\/learning\/wp-content\/uploads\/2018\/12\/Screen-Shot-2018-12-12-at-22.14.48-768x480.jpg 768w, https:\/\/luckytruedev.com\/learning\/wp-content\/uploads\/2018\/12\/Screen-Shot-2018-12-12-at-22.14.48-110x69.jpg 110w, https:\/\/luckytruedev.com\/learning\/wp-content\/uploads\/2018\/12\/Screen-Shot-2018-12-12-at-22.14.48-420x263.jpg 420w, https:\/\/luckytruedev.com\/learning\/wp-content\/uploads\/2018\/12\/Screen-Shot-2018-12-12-at-22.14.48-688x430.jpg 688w, https:\/\/luckytruedev.com\/learning\/wp-content\/uploads\/2018\/12\/Screen-Shot-2018-12-12-at-22.14.48-20x13.jpg 20w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption>Sesudah Reset Commit<br><\/figcaption><\/figure>\n\n\n\n<p>jika kalian sudah berhasil, commit pada git akan terset dari semula 3 menjadi hanya 1 commit (pada kasus dan repositori ini). dan itu tandanya kalian berhasil mereset history commit. jika pada saat reset ada tulisan &#8220;Everything up-to-date&#8221; silahkan coba lagi sampai tulisan itu tidak ada, atau ulangi step dari awal. Mungkin itu aja yang ingin gw share, makasih ya \ud83d\ude42<\/p>\n<div id=\"lucky-3383738185\" class=\"lucky-after-content lucky-entity-placement\"><script async src=\"\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js?client=ca-pub-5605825534849002\" crossorigin=\"anonymous\"><\/script><ins class=\"adsbygoogle\" style=\"display:block;\" data-ad-client=\"ca-pub-5605825534849002\" \ndata-ad-slot=\"5317815257\" \ndata-ad-format=\"auto\" data-full-width-responsive=\"true\"><\/ins>\n<script> \n(adsbygoogle = window.adsbygoogle || []).push({}); \n<\/script>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>halo, kali ini gw mau share cara Reset \/ Hapus History Commit pada Repositori di git, pada kasus ini gw pake IDE CLion &amp; Command Line Tools, langsung aja ya. Ini adalah gambar sebelum direset, lalu kita buka IDE (Bebas) untuk kasus ini gw pake IDE CLion buat bikin program C++, lalu kemenu dibagain bawah, [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":492,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[29],"tags":[],"class_list":["post-490","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ltdv-git-tutor"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/luckytruedev.com\/learning\/wp-json\/wp\/v2\/posts\/490","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/luckytruedev.com\/learning\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/luckytruedev.com\/learning\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/luckytruedev.com\/learning\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/luckytruedev.com\/learning\/wp-json\/wp\/v2\/comments?post=490"}],"version-history":[{"count":1,"href":"https:\/\/luckytruedev.com\/learning\/wp-json\/wp\/v2\/posts\/490\/revisions"}],"predecessor-version":[{"id":2333,"href":"https:\/\/luckytruedev.com\/learning\/wp-json\/wp\/v2\/posts\/490\/revisions\/2333"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/luckytruedev.com\/learning\/wp-json\/wp\/v2\/media\/492"}],"wp:attachment":[{"href":"https:\/\/luckytruedev.com\/learning\/wp-json\/wp\/v2\/media?parent=490"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/luckytruedev.com\/learning\/wp-json\/wp\/v2\/categories?post=490"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/luckytruedev.com\/learning\/wp-json\/wp\/v2\/tags?post=490"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}