learn | unlearn | relearn

I have to build a listbox for one customer app showing the version history of their app. The easiest way is obviously to first upload the git log into a database, but the standard log looks like this:

Command:

git log

Output:

Beautiful, but not what I needed. I wanted a csv format for easy upload to my database and obviously the date should be in SQL format.

The following code will help you on this. Just run it in the root folder of your GIT enabled project in a terminal windows on your  macOS.

git log --pretty=format:'%ad;%s' --date=format:'%Y-%m-%d %H:%M:%S' > YOURPATH/myGitLog.txt

This will provided me with the desired output for an easy upload to a database and to go from there.

Comments

Sign in or become a jeannot-muller.com member to join the conversation.
Just enter your email below to get a log in link.



You’ve successfully subscribed to jeannot-muller.com
Welcome back! You’ve successfully signed in.
Great! You’ve successfully signed up.
Your link has expired
Success! Check your email for magic link to sign-in.