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.
Asked
Active
Viewed 2,408 times
5

Benjamin Muschko
- 32,442
- 9
- 61
- 82
-
I think it only does the "Enter after each line" if your output is going to the console. So if you pipe it to another app, or redirect the output to a file, I think you'll get it all at once. Haven't verified this, though. – Joe White Apr 07 '12 at 16:05
1 Answers
12
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.

Community
- 1
- 1

Yuval Adam
- 161,610
- 92
- 305
- 395
-
Thanks for your response but I don't want to write it to a file. I'd like to process the output on the fly. – Benjamin Muschko Apr 07 '12 at 16:14
-