# [PATCH] git-commit: document --date=now for amended commits

2 messages from 2026-11-23 to 2026-11-23. Participants: Gontu Sujith Reddy via GitGitGadget, Junio C Hamano.
Thread: https://gitlist.dev/t/66918

## Gontu Sujith Reddy via GitGitGadget, 2026-11-23 09:34

Subject: [PATCH] git-commit: document --date=now for amended commits
Message-ID: <pull.2502.git.git.1795426497536.gitgitgadget@gmail.com>
URL: https://gitlist.dev/e/pull.2502.git.git.1795426497536.gitgitgadget%40gmail.com

```
From: GontuSujithReddy <gontusujith2009@gmail.com>

Amending a commit normally preserves its original author date. Mention
that --date=now sets the author date to the current time when amending.

Signed-off-by: GontuSujithReddy <gontusujith2009@gmail.com>
---
    git-commit: document --date=now for amended commits

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-2502%2FGontuSujithReddy%2Fdoc-commit-date-now-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-2502/GontuSujithReddy/doc-commit-date-now-v1
Pull-Request: https://github.com/git/git/pull/2502

 Documentation/git-commit.adoc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/git-commit.adoc b/Documentation/git-commit.adoc
index 8329c1034b..ba0d5aeb8f 100644
--- a/Documentation/git-commit.adoc
+++ b/Documentation/git-commit.adoc
@@ -182,6 +182,8 @@ See linkgit:git-rebase[1] for details.
 
 `--date=<date>`::
 	Override the author date used in the commit.
+	When amending a commit, use `--date=now` to set the author date
+	to the current time.
 
 `-m <msg>`::
 `--message=<msg>`::

base-commit: f7de81456940dd6f3274e461149bba12965de609
-- 
gitgitgadget


```

## Junio C Hamano, 2026-11-23 19:24

Subject: Re: [PATCH] git-commit: document --date=now for amended commits
Message-ID: <xmqqik1n5p2k.fsf@gitster.g>
URL: https://gitlist.dev/e/xmqqik1n5p2k.fsf%40gitster.g
In-Reply-To: <pull.2502.git.git.1795426497536.gitgitgadget@gmail.com>

```
"Gontu Sujith Reddy via GitGitGadget" <gitgitgadget@gmail.com> writes:

> From: GontuSujithReddy <gontusujith2009@gmail.com>
>
> Amending a commit normally preserves its original author date. Mention
> that --date=now sets the author date to the current time when amending.
>
> Signed-off-by: GontuSujithReddy <gontusujith2009@gmail.com>
> ---

Your message identifies you as "Gontu Sujith Reddy" (before the "via
GitGitGadget" comment) on the mail envelope Sender: header, and if that
is how your name is usually spelled, we would prefer to have the name
with the same spelling on the in-body "From:" line and also on your
sign-off, not squashed into a single long word.

>     git-commit: document --date=now for amended commits

You do not have to write what you wrote elsewhere here.  The space under
the three dashes is to communicate what should not be recorded in the
commit log message for "git log" readers in the longer term but is
relevant and helpful for reviewers to know while reviewing the patch.

I am mildly against this update.

Whether you are creating a new commit or amending an existing commit,
the option overrides the author date.  Singling out "When amending a
commit" in the description of the --date option gives an impression
that it is the primary purpose of the option, which is not the case.

Preserving the author date is what the description of --amend should
mention, and if it does not already, there is a patch opportunity for
you to improve the documentation ;-).  And in the context of that
description, it may be a good idea to mention that the user could
override it with --date when they have a good reason to do so.

But the author date is not the only thing that "git commit --amend"
preserves (the author identity is also preserved when you are amending
somebody else's commit).  For that reason, it would be a good idea to
mention the --reset-author option as well when you bring up the --date
option there.



> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-2502%2FGontuSujithReddy%2Fdoc-commit-date-now-v1
> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-2502/GontuSujithReddy/doc-commit-date-now-v1
> Pull-Request: https://github.com/git/git/pull/2502
>
>  Documentation/git-commit.adoc | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/Documentation/git-commit.adoc b/Documentation/git-commit.adoc
> index 8329c1034b..ba0d5aeb8f 100644
> --- a/Documentation/git-commit.adoc
> +++ b/Documentation/git-commit.adoc
> @@ -182,6 +182,8 @@ See linkgit:git-rebase[1] for details.
>  
>  `--date=<date>`::
>  	Override the author date used in the commit.
> +	When amending a commit, use `--date=now` to set the author date
> +	to the current time.
>  
>  `-m <msg>`::
>  `--message=<msg>`::
>
> base-commit: f7de81456940dd6f3274e461149bba12965de609


```
