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

后端 未结 10 1528
醉酒成梦
醉酒成梦 2020-12-07 12:11

I want to export the log of all commits in a repo to a text file, is there any way to do this?

相关标签:
10条回答
  • 2020-12-07 12:47
    git log | clip 
    

    copies to clipboard, then paste to a textfile

    0 讨论(0)
  • 2020-12-07 12:56

    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.

    0 讨论(0)
  • 2020-12-07 12:56

    It's simple. if you don't matter save a file you need the open terminal

    cd {your git repository}
    git log > your_file_name.txt
    

    if you need a special directory, just write all path in the right side, like this

    cd {your git repository}
    git log > /home/user/logs/your_file_name.txt
    

    This directory, for example, you could use any one of your needs. I write a log like this just now.

    This example show how to write a text in a file via bash

    0 讨论(0)
  • 2020-12-07 12:57

    Have you tried git log > log.txt ?

    0 讨论(0)
提交回复
热议问题