How do I export a git log to a text file?

You'll just need to disable the pager.

git --no-pager log > log.txt

If you want to format it to look nicer, you can use parameters of git log.


You may use the > symbol send the output to a file. For example:

git log > commits.txt

Have you tried git log > log.txt ?


git log | clip 

copies to clipboard, then paste to a textfile.

(Especially if you have the problem of line-ending and thus by this method you can copy and paste it in a Microsoft word document(.docx); so there would be a new line for each commit!!!)

Tags:

Git