<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Alex</title>
    <description>The latest articles on DEV Community by Alex (@giteditdatecom).</description>
    <link>https://dev.to/giteditdatecom</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4024564%2F9147ff85-da17-4083-a824-06cf173bf580.png</url>
      <title>DEV Community: Alex</title>
      <link>https://dev.to/giteditdatecom</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/giteditdatecom"/>
    <language>en</language>
    <item>
      <title>How to Change the Date of an Old Git Commit</title>
      <dc:creator>Alex</dc:creator>
      <pubDate>Fri, 10 Jul 2026 22:16:45 +0000</pubDate>
      <link>https://dev.to/giteditdatecom/how-to-change-the-date-of-an-old-git-commit-2e8a</link>
      <guid>https://dev.to/giteditdatecom/how-to-change-the-date-of-an-old-git-commit-2e8a</guid>
      <description>&lt;p&gt;Sooner or later, most Git users encounter a situation where a commit has the wrong timestamp.&lt;/p&gt;

&lt;p&gt;Maybe your system clock was incorrect.&lt;/p&gt;

&lt;p&gt;Maybe you imported commits from another repository.&lt;/p&gt;

&lt;p&gt;Maybe you rebased a branch and unexpectedly changed commit dates.&lt;/p&gt;

&lt;p&gt;Or maybe you're simply curious about how Git stores commit metadata.&lt;/p&gt;

&lt;p&gt;In this article, we'll look at how to change the date of an old Git commit and why the process is more complicated than most developers expect.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Git Commit Dates Matter
&lt;/h2&gt;

&lt;p&gt;Every Git commit contains more than just code changes.&lt;/p&gt;

&lt;p&gt;A commit also stores metadata, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Author&lt;/li&gt;
&lt;li&gt;Committer&lt;/li&gt;
&lt;li&gt;Author Date&lt;/li&gt;
&lt;li&gt;Commit Date&lt;/li&gt;
&lt;li&gt;Commit Message&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can inspect a commit with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git show &lt;span class="nt"&gt;--pretty&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;fuller HEAD
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;AuthorDate: Mon Jul 1 10:00:00 2026 +0000
CommitDate: Mon Jul 1 10:00:00 2026 +0000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These timestamps become part of the commit object itself.&lt;/p&gt;

&lt;p&gt;This means changing a date creates a new commit hash.&lt;/p&gt;

&lt;p&gt;We'll come back to that later.&lt;/p&gt;




&lt;h2&gt;
  
  
  Changing the Date of the Last Commit
&lt;/h2&gt;

&lt;p&gt;If you only need to modify the most recent commit, Git provides a relatively straightforward solution.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;GIT_COMMITTER_DATE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"2026-07-01T10:00:00"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
git commit &lt;span class="nt"&gt;--amend&lt;/span&gt; &lt;span class="nt"&gt;--no-edit&lt;/span&gt; &lt;span class="nt"&gt;--date&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"2026-07-01T10:00:00"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After running the command:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Author Date is updated&lt;/li&gt;
&lt;li&gt;Commit Date is updated&lt;/li&gt;
&lt;li&gt;Commit hash changes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can verify the result:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git show &lt;span class="nt"&gt;--pretty&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;fuller HEAD
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For a single commit, this approach is usually sufficient.&lt;/p&gt;




&lt;h2&gt;
  
  
  Changing the Date of an Older Commit
&lt;/h2&gt;

&lt;p&gt;Things become more complicated when the commit is not the latest one.&lt;/p&gt;

&lt;p&gt;Imagine a history like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;A
B
C
D
HEAD
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Suppose you want to change the date of commit &lt;code&gt;B&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Git cannot simply modify that commit in place.&lt;/p&gt;

&lt;p&gt;Instead, Git must rewrite history.&lt;/p&gt;

&lt;p&gt;The typical approach is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git rebase &lt;span class="nt"&gt;-i&lt;/span&gt; HEAD~4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Git will open an editor:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pick A
pick B
pick C
pick D
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Change the target commit:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pick A
edit B
pick C
pick D
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save and exit.&lt;/p&gt;

&lt;p&gt;Git stops at commit &lt;code&gt;B&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Now amend the date:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;GIT_COMMITTER_DATE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"2026-07-01T10:00:00"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
git commit &lt;span class="nt"&gt;--amend&lt;/span&gt; &lt;span class="nt"&gt;--no-edit&lt;/span&gt; &lt;span class="nt"&gt;--date&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"2026-07-01T10:00:00"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Continue the rebase:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git rebase &lt;span class="nt"&gt;--continue&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Git rebuilds the remaining commits on top of the modified commit.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why This Changes Commit Hashes
&lt;/h2&gt;

&lt;p&gt;Many developers are surprised by what happens next.&lt;/p&gt;

&lt;p&gt;The code hasn't changed.&lt;/p&gt;

&lt;p&gt;The files haven't changed.&lt;/p&gt;

&lt;p&gt;The commit message hasn't changed.&lt;/p&gt;

&lt;p&gt;Only the timestamp changed.&lt;/p&gt;

&lt;p&gt;Yet Git generates a completely different commit hash.&lt;/p&gt;

&lt;p&gt;This happens because Git hashes the entire commit object.&lt;/p&gt;

&lt;p&gt;The commit hash depends on:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Tree&lt;/li&gt;
&lt;li&gt;Parent commit&lt;/li&gt;
&lt;li&gt;Author&lt;/li&gt;
&lt;li&gt;Author Date&lt;/li&gt;
&lt;li&gt;Committer&lt;/li&gt;
&lt;li&gt;Commit Date&lt;/li&gt;
&lt;li&gt;Commit Message&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Changing any of these fields creates a new object.&lt;/p&gt;

&lt;p&gt;Even changing a timestamp by one second produces a different SHA.&lt;/p&gt;




&lt;h2&gt;
  
  
  Changing Dates for Multiple Commits
&lt;/h2&gt;

&lt;p&gt;Now imagine changing the dates of 20 commits.&lt;/p&gt;

&lt;p&gt;Interactive rebase becomes tedious.&lt;/p&gt;

&lt;p&gt;You need to:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Stop at each commit.&lt;/li&gt;
&lt;li&gt;Amend metadata.&lt;/li&gt;
&lt;li&gt;Continue the rebase.&lt;/li&gt;
&lt;li&gt;Resolve conflicts if they appear.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For larger repositories this quickly becomes painful.&lt;/p&gt;

&lt;p&gt;Historically, developers used tools like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git filter-branch
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git filter-repo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;to rewrite commit metadata in bulk.&lt;/p&gt;

&lt;p&gt;These tools are powerful but can be intimidating if you don't regularly rewrite Git history.&lt;/p&gt;




&lt;h2&gt;
  
  
  Be Careful With Shared Branches
&lt;/h2&gt;

&lt;p&gt;Before changing commit dates, remember that history rewriting affects commit hashes.&lt;/p&gt;

&lt;p&gt;If you've already pushed commits:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git push origin main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and later rewrite dates:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git rebase &lt;span class="nt"&gt;-i&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;you'll need to force push:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git push &lt;span class="nt"&gt;--force-with-lease&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This can disrupt teammates who already based work on the old history.&lt;/p&gt;

&lt;p&gt;As a general rule:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Rewriting local history is usually safe.&lt;/li&gt;
&lt;li&gt;Rewriting shared history requires caution.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  A Simpler Alternative
&lt;/h2&gt;

&lt;p&gt;After working with Git history rewriting for a while, I realized that changing commit dates often involves more commands than expected.&lt;/p&gt;

&lt;p&gt;For a single commit:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git commit &lt;span class="nt"&gt;--amend&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;is manageable.&lt;/p&gt;

&lt;p&gt;For multiple commits, interactive rebases become tedious and error-prone.&lt;/p&gt;

&lt;p&gt;That's one of the reasons I built &lt;strong&gt;GitEditDate&lt;/strong&gt; — a small tool that helps edit Git commit timestamps without manually stepping through complex rebase workflows.&lt;/p&gt;

&lt;p&gt;Whether you use GitEditDate or standard Git commands, understanding how commit dates work makes history rewriting much less intimidating.&lt;/p&gt;




&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Changing the date of an old Git commit is possible, but Git intentionally makes it explicit.&lt;/p&gt;

&lt;p&gt;A timestamp is not just a label attached to a commit.&lt;/p&gt;

&lt;p&gt;It's part of the commit object itself.&lt;/p&gt;

&lt;p&gt;Because of that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Changing a date changes the commit hash.&lt;/li&gt;
&lt;li&gt;Changing an old date rewrites history.&lt;/li&gt;
&lt;li&gt;Rewriting history affects every descendant commit.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once you understand those rules, modifying commit dates becomes much easier to reason about.&lt;/p&gt;

&lt;p&gt;And if you've ever wondered why a simple timestamp change can trigger a cascade of new commit hashes, now you know the answer.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>cli</category>
      <category>git</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Why Git Has Two Dates: Author Date vs Commit Date</title>
      <dc:creator>Alex</dc:creator>
      <pubDate>Fri, 10 Jul 2026 22:15:47 +0000</pubDate>
      <link>https://dev.to/giteditdatecom/why-git-has-two-dates-author-date-vs-commit-date-pca</link>
      <guid>https://dev.to/giteditdatecom/why-git-has-two-dates-author-date-vs-commit-date-pca</guid>
      <description>&lt;p&gt;Most developers assume a Git commit has a single timestamp.&lt;/p&gt;

&lt;p&gt;That's not true.&lt;/p&gt;

&lt;p&gt;Every commit actually contains &lt;strong&gt;two different dates&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Author Date&lt;/li&gt;
&lt;li&gt;Commit Date&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Most of the time they are identical, which is why many developers never notice the distinction.&lt;/p&gt;

&lt;p&gt;But once you start rebasing, cherry-picking, or rewriting history, the difference becomes important.&lt;/p&gt;

&lt;p&gt;Understanding these two timestamps can explain some very confusing Git and GitHub behavior.&lt;/p&gt;

&lt;h2&gt;
  
  
  Every Commit Contains More Metadata Than You Think
&lt;/h2&gt;

&lt;p&gt;Let's inspect a commit:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git show &lt;span class="nt"&gt;--pretty&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;fuller HEAD
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;commit 7fd2f85...

Author: John Doe
AuthorDate: Mon Jul 1 10:00:00 2026 +0000

Commit: John Doe
CommitDate: Thu Jul 10 18:42:00 2026 +0000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Notice that Git stores two separate timestamps.&lt;/p&gt;

&lt;p&gt;Why?&lt;/p&gt;

&lt;p&gt;Because they represent different events.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Is Author Date?
&lt;/h2&gt;

&lt;p&gt;The Author Date represents when the change was originally created.&lt;/p&gt;

&lt;p&gt;Imagine this workflow:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;July 1   Create commit
July 5   Open pull request
July 10  Rebase branch
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The code was written on July 1.&lt;/p&gt;

&lt;p&gt;That's the Author Date.&lt;/p&gt;

&lt;p&gt;It answers the question:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;When was this work originally authored?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  What Is Commit Date?
&lt;/h2&gt;

&lt;p&gt;The Commit Date represents when the current commit object was created.&lt;/p&gt;

&lt;p&gt;This is where many developers get surprised.&lt;/p&gt;

&lt;p&gt;When Git rewrites history, it creates completely new commit objects.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git commit &lt;span class="nt"&gt;--amend&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git rebase &lt;span class="nt"&gt;-i&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Both operations generate new commits.&lt;/p&gt;

&lt;p&gt;As a result, the Commit Date changes.&lt;/p&gt;

&lt;p&gt;It answers the question:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;When was this version of the commit created?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Why The Dates Become Different
&lt;/h2&gt;

&lt;p&gt;Let's take a simple example.&lt;/p&gt;

&lt;p&gt;You create a commit:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;July 1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A week later you perform an interactive rebase:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;July 8
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Result:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;AuthorDate = July 1
CommitDate = July 8
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Nothing is wrong.&lt;/p&gt;

&lt;p&gt;Git is preserving the original creation time while also recording when the rewritten commit object appeared.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why GitHub Sometimes Looks Wrong
&lt;/h2&gt;

&lt;p&gt;Many developers first encounter this distinction on GitHub.&lt;/p&gt;

&lt;p&gt;You've probably seen something like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Commit created: July 1
Displayed on GitHub: July 8
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and wondered:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Why did GitHub change my commit date?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Usually GitHub isn't wrong.&lt;/p&gt;

&lt;p&gt;It's simply displaying metadata that changed after a rebase, cherry-pick, or amend operation.&lt;/p&gt;

&lt;p&gt;Understanding Author Date and Commit Date immediately explains this behavior.&lt;/p&gt;

&lt;h2&gt;
  
  
  Changing Commit Dates
&lt;/h2&gt;

&lt;p&gt;Changing the latest commit date is relatively straightforward.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;GIT_COMMITTER_DATE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;date&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
git commit &lt;span class="nt"&gt;--amend&lt;/span&gt; &lt;span class="nt"&gt;--no-edit&lt;/span&gt; &lt;span class="nt"&gt;--date&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;date&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Changing older commits is significantly more annoying.&lt;/p&gt;

&lt;p&gt;You typically need:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git rebase &lt;span class="nt"&gt;-i&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;followed by manual date editing and history rewriting.&lt;/p&gt;

&lt;p&gt;This becomes painful when multiple commits are involved.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Commit Hashes Change
&lt;/h2&gt;

&lt;p&gt;Another common surprise:&lt;/p&gt;

&lt;p&gt;Changing only the timestamp changes the commit hash.&lt;/p&gt;

&lt;p&gt;Many developers expect the hash to stay the same because the code didn't change.&lt;/p&gt;

&lt;p&gt;But Git hashes the entire commit object, including metadata.&lt;/p&gt;

&lt;p&gt;That means:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Same code
Same files
Same message
Different timestamp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;results in:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Different commit hash
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is expected behavior.&lt;/p&gt;

&lt;h2&gt;
  
  
  When Would You Change Commit Dates?
&lt;/h2&gt;

&lt;p&gt;There are legitimate reasons:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fixing incorrect system clocks&lt;/li&gt;
&lt;li&gt;Repository migrations&lt;/li&gt;
&lt;li&gt;Cleaning imported history&lt;/li&gt;
&lt;li&gt;Reconstructing chronological order&lt;/li&gt;
&lt;li&gt;Educational demonstrations&lt;/li&gt;
&lt;li&gt;Privacy reasons&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In most cases you should avoid rewriting public history, but for personal branches and local repositories it can be useful.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Git stores two timestamps because they answer two different questions:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Author Date&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;When was this work originally created?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Commit Date&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;When was this commit object created?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Once you understand the distinction, many confusing Git and GitHub behaviors suddenly make sense.&lt;/p&gt;

&lt;p&gt;While researching Git timestamps, I ended up building a small tool called &lt;strong&gt;GitEditDate&lt;/strong&gt; that makes editing commit dates easier without manually wrestling with complex rebase commands.&lt;/p&gt;

&lt;p&gt;Until then, I had no idea how much metadata was hiding inside a simple Git commit.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>git</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
