Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Process full content of git blame

Tags:

git

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.

like image 694
Benjamin Muschko Avatar asked Apr 07 '12 15:04

Benjamin Muschko


1 Answers

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.

like image 186
Yuval Adam Avatar answered Oct 12 '22 03:10

Yuval Adam