I want to export the log of all commits in a repo to a text file, is there any way to do this?
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.