Format Git Logs

Format Git Logs

I have to build a list box 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: 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 with this. Just run it in the root folder of your GIT-enabled project in a terminal window on your macOS.

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

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