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

  Work with me!


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 )

Thank you for reading! And see you soon on Strangebuzz! πŸ˜‰

COil

[πŸ‡¬πŸ‡§] Snippet 49/50 Getting the first commit date with Git www.strangebuzz.com/en/snippets/... #git #tips

[image or embed]

— COil 🐝 (@coil.ooo) 30 dΓ©cembre 2024 Γ  13:10