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

后端 未结 10 1553
醉酒成梦
醉酒成梦 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: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

提交回复
热议问题