# How do I change the AuthorDate and CommitDate of all my commits?

2 messages from 2020-01-16 to 2020-02-14. Participants: gritzmann, Jeff King.
Thread: https://gitlist.dev/t/52647

## gritzmann, 2020-01-16 11:30

Subject: How do I change the AuthorDate and CommitDate of all my commits?
Message-ID: <Ogtz26tj4ZgCMamF3jprc21AvPiEvWlYS9IgAwPDAPOJHd0THDCaNSwNi6qjUxE9ZknGw-87P7wnnQUkH3khrFnEXoAy8VvmEuBpVLpQ3Qw=@protonmail.com>
URL: https://gitlist.dev/e/Ogtz26tj4ZgCMamF3jprc21AvPiEvWlYS9IgAwPDAPOJHd0THDCaNSwNi6qjUxE9ZknGw-87P7wnnQUkH3khrFnEXoAy8VvmEuBpVLpQ3Qw%3D%40protonmail.com

```
Hi,

I*m looking to completely anonymize the timestamps of my files and repos For the files themselves I changed their access, modify, change and birth times like this: `touch -acm -d "1980-01-01 00:00:00"`.

But how do I do the same for the AuthorDate and CommitDate of all my commits?

Thanks!

Sent with ProtonMail Secure Email.

```

## Jeff King, 2020-02-14 06:32

Subject: Re: How do I change the AuthorDate and CommitDate of all my commits?
Message-ID: <20200214063213.GC605125@coredump.intra.peff.net>
URL: https://gitlist.dev/e/20200214063213.GC605125%40coredump.intra.peff.net
In-Reply-To: <Ogtz26tj4ZgCMamF3jprc21AvPiEvWlYS9IgAwPDAPOJHd0THDCaNSwNi6qjUxE9ZknGw-87P7wnnQUkH3khrFnEXoAy8VvmEuBpVLpQ3Qw=@protonmail.com>

```
On Thu, Jan 16, 2020 at 11:30:10AM +0000, gritzmann wrote:

> I*m looking to completely anonymize the timestamps of my files and
> repos For the files themselves I changed their access, modify, change
> and birth times like this: `touch -acm -d "1980-01-01 00:00:00"`.
> 
> But how do I do the same for the AuthorDate and CommitDate of all my
> commits?

If you're just creating the commits now, you can set $GIT_AUTHOR_DATE
and $GIT_COMMITTER_DATE in the environment. Like:

  export GIT_AUTHOR_DATE='1980-01-01 00:00:00 +0000'
  export GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"

If you have existing commits, you'll have to look into rewriting them
with git-filter-branch, or piping git-fast-export to git-fast-import and
modifying the stream in between.

-Peff

```
