Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have a large CSV file where data usally only get appended and then git committed. But I am curious if there were some commits in the past which deleted lines from this file. To date, several hundred commits have been made on this file.

Is there an easy way to tell if there were git commits which deleted lines?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
4.0k views
Welcome To Ask or Share your Answers For Others

1 Answer

If you just want to answer your question with "yes/no", then running git log -p and searching (/) for ^-[^-] would be a quick and dirty way to find removed lines (the regexp means lines starting with - but not more than one, because that would match the --- header for each diff).


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...