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
CR and LF are control characters or bytecode that can be used to mark a line break in a text file. CR = Carriage Return ( \r , 0x0D in hexadecimal, 13 in decimal) — moves the cursor to the beginning of the line without advancing to the next line.
The command for that would be git log -n where n represents the number up to which commit you to want to see the logs.
Git log is a utility tool to review and read a history of everything that happens to a repository. Multiple options can be used with a git log to make history more specific. Generally, the git log is a record of commits.
You can use %n
as a new line:
git log --pretty=tformat:"%ai %s%n" > log.log
Pjz's answer is not quite right for Windows, but with a little playing around I got it to work. The 10 and 13 characters needed to be reversed, and they needed to be in proper hex format:
git log --pretty=tformat:"%ai %s%x0D%x0A" >log.log
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With