Benjamin Muschko
Benjamin Muschko

Reputation: 33426

Process full content of git blame

I'd like to process the full output of git blame on a specific file. Some of the files are too long to fit on the screen so the user is required to scroll down line by line by pressing the Enter key. Is there a command line option I am missing that would print out the full output? Alternatively, I could probably use the -L option to define the line start- and endpoints. However, this would require my the figure out how many lines the file has and run the command multiple times which I'd like to avoid.

Upvotes: 5

Views: 2782

Answers (1)

Yuval Adam
Yuval Adam

Reputation: 165182

Use the --no-pager arg:

git --no-pager blame file.name

Also, redirecting the output to a file will achieve the same effect:

git blame file.name > output.txt

You also have various ways of temporarily or permanently disabling git's paging with the core.pager config, and various environment vars.

See How do I prevent git diff from using a pager? for more info.

Upvotes: 12

Related Questions