D
D
Dima2017-02-07 16:29:02
git
Dima, 2017-02-07 16:29:02

How to find in GIT starting from which revision a given piece of text appeared (or disappeared) in the text of a file?

How to find in GIT starting from which revision a given piece of text appeared (or disappeared) in the text of a file?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
aol-nnov, 2017-02-07
@v_m_smith

I'll have to puff with the translation of my answer, but it deserves a green check, it's 146%.

If you know the contents of the line, this is an ideal use case for:
git log -S <search_string> -- path/to/file
which shows you commits which introduce or remove an instance of that string.

M
Maxim Moseychuk, 2017-02-07
@fshp

git blame - Shows which commit each line was added to. For deleted lines, you will have to look at the entire history.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question