Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

git

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

like image 729
Inverted Llama Avatar asked Apr 26 '12 09:04

Inverted Llama


People also ask

How do you create a text file in git?

First of all open the folder you want to create the new file in your text editor like 'brackets' or 'VS studio'. Then simply type touch newFile. txt in git-bash . Then go back to text editor you have previously open and you can see the newFile.

What is the difference between git log and git log?

log is that the log is a public accounting of the repository's commit history while the reflog is a private, workspace-specific accounting of the repo's local commits. The Git log is part of the Git repository and is replicated after a push, fetch or pull. In contrast, the Git reflog is not part of the replicated repo.


2 Answers

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.

like image 146
eis Avatar answered Sep 28 '22 02:09

eis


Have you tried git log > log.txt ?

like image 41
Hindol Avatar answered Sep 28 '22 00:09

Hindol