to output to a file:
git log > filename.log
To specify a format, like you want everything on one line
git log --pretty=oneline >filename.log
or you want it a format to be emailed via a program like sendmail
git log --pretty=email |email-sending-script.sh
to generate JSON, YAML or XML it looks like you need to do something like:
git log --pretty=format:"%h%x09%an%x09%ad%x09%s"
This gist (not mine) perfectly formats output in JSON:
https://gist.github.com/1306223
See also:
- http://git-scm.com/book/en/Git-Basics-Viewing-the-Commit-History
- Git how to save a preset git log –format
- How to parse the output of git log