uhb9pq
Last Updated: May 23, 2016
·
64
· acdesouza
2de33da0b65c957690a1a07fc3eda839

Git log line selection

How to follow changes on lines of a file?

Since git 1.8.4 you can git log just a bunch of lines in a file.
$ git log -L<Line number>,<range>:<filename>

To see changes on lines 4 to 32, in app/assets/javascripts/application.js

$ git log -L4,32:app/assets/javascripts/application.js

To see changes on 10 lines, after line 20, in app/assets/javascripts/application.js

$ git log -L20,+10:app/assets/javascripts/application.js
Say Thanks
Respond
Filed Under

Awesome Job

0957a9c2 0855 11e8 909a 82469fe19f14
Senior Backend Engineer
·
San Francisco, California
·
Full Time