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

Categories

0 votes
4.4k views
in Technique[技术] by (71.8m points)

csv - How to find git commits which deleted lines in a file

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?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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).


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...