Search code examples
gitline-breaks

git log with line break when exported to text file


How do I add a line break for my custom git log?

git log --pretty=tformat:"%ai %s" > log.log

I want a line break after %s


Solution

  • You can use %n as a new line:

    git log --pretty=tformat:"%ai %s%n" > log.log