<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>DevOps on Nathan Debilloëz - Blog</title><link>https://nde-code.github.io/blog/en/tags/devops/</link><description>Recent content in DevOps on Nathan Debilloëz - Blog</description><generator>Hugo</generator><language>en</language><lastBuildDate>Thu, 25 Jun 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://nde-code.github.io/blog/en/tags/devops/index.xml" rel="self" type="application/rss+xml"/><item><title>Recreate a project's Git history from its current state</title><link>https://nde-code.github.io/blog/en/posts/how-to-clean-git-commit-history/</link><pubDate>Thu, 25 Jun 2026 00:00:00 +0000</pubDate><guid>https://nde-code.github.io/blog/en/posts/how-to-clean-git-commit-history/</guid><description>&lt;h1 id="introduction"&gt;Introduction:&lt;/h1&gt;
&lt;p&gt;This guide explains how to recreate a project&amp;rsquo;s Git history from its current state by deleting the Git metadata from the local repository, initializing a new repository, and then replacing the history of the remote &lt;code&gt;main&lt;/code&gt; branch.&lt;/p&gt;
&lt;p&gt;Although not common in day-to-day development, this operation is useful in several specific situations, for example:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Accidentally exposing secrets:&lt;/strong&gt; always revoke them first (API keys, access tokens, passwords, etc.). Resetting the repository history helps remove them from the repository&amp;rsquo;s visible history, but it &lt;strong&gt;does not guarantee&lt;/strong&gt; that the data has disappeared from existing clones, &lt;em&gt;forks&lt;/em&gt;, or caches.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Cleaning up a project:&lt;/strong&gt; once the initial development phase is over, you may want to start with a clean history by removing the early work-in-progress &lt;em&gt;commits&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Starting fresh after major changes:&lt;/strong&gt; following a significant refactor or a long period of development, resetting the history can provide a clean baseline and make the repository easier to understand.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;⚠️ Warning:&lt;/strong&gt; this operation is irreversible. It will permanently overwrite the history of the remote &lt;code&gt;main&lt;/code&gt; branch. If other people collaborate on this project, they should delete their local copy and clone the repository again once the operation is complete.&lt;/p&gt;</description></item></channel></rss>