N
N
Ndochp2015-02-16 14:54:38
git
Ndochp, 2015-02-16 14:54:38

How to find out when a line appeared in a file in a Git repository?

There is a file in the Git repository. I need to find out when and why a certain line appeared (or disappeared) in it. The command
git log -p -- FileName>Log.txt
gives the entire history of the file, and by searching for Log.txt I can catch all the commits with the required time, but I want only them to be displayed immediately. Unfortunately --grep only searches the description fields, not the contents of the changes. Maybe there is some other tricky key that will do what you need?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Victor, 2015-02-16
@Ndochp

git blame

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question