Search notes:

git commit

Record changes to the repository.

Set the author date

The --date option allows to specify (or more accurately override) the commit's so-called author date. The author date is typically interpreted as the timestamp when a commit object was first added to a repository.
In order to demonstrate this, a git repository is created:
$ mkdir repo
$ cd    repo

$ git init
Then, three commit objects are created, each with an arbitrary author date:
'one'    > file.txt
git add    file.txt
commit     file.txt -m "add numbers.txt" --date '2021-01-01 11:12:13'

'two'    > file.txt
git commit file.txt -m "Version 2"       --date '2021-02-02 12:22:20'

'three'  > file.txt
git commit file.txt -m "Version 3"       --date '2021-03-13 03:33:30'
Finally, the file's log is inspected, using a format that just prints the author date (%ai) and the commit message's (%s) subject:
git log --format='%ai  %s' --reverse file.txt
The command prints
2021-01-01 11:12:13 +0100  add numbers.txt
2021-02-02 12:22:20 +0200  Version 2
2021-03-13 03:33:30 +0300  Version 3
Cleaning up:
cd ..
rmdir -r -force repo

See also

git commands

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1759391028, '216.73.216.42', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/version-control-systems/git/commands/commit(75): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78