Getting the first commit date with Git
Published on 2024-12-27 • Modified on 2024-12-27
This snippet shows how to get the first commit date of a Git repository. The trick is to use the --reverse
flag of the log Git command. It is helpful because GitHub display relative dates like "three weeks ago" which are not precise.
git log --reverse --format="%h %ad %s" --date=short | head -n 5
More on Stackoverflow Random snippet
Call to action
Did you like this post? You can help me back in several ways: (use the "reply" link on the right to comment or to contact me )
- Report any error/typo.
- Report something that could be improved.
- Like and repost!
- Follow me on Bluesky π¦
- Subscribe to the RSS feed.
- Click on the More on Stackoverflow buttons to make me win "Announcer" badges π .
Thank you for reading! And see you soon on Strangebuzz! π
[π¬π§] Snippet 49/50 Getting the first commit date with Git www.strangebuzz.com/en/snippets/... #git #tips
— COil π (@coil.ooo) 30 dΓ©cembre 2024 Γ 13:10
[image or embed]