2022.02.09 How to find commit when line was deleted/removed?
git log -c -S'missingtext' /path/to/file
for example, i was looking for when was webpackJson got deleted in create-react-app repo
git clone https://github.com/facebook/create-react-app.git
git log -c -S'webpackJson' packages/react-scripts/config/webpack.config.js
then I can see
following to the above commit message I can see it's because webpack 5 config
commit f0a837c1f07ebd963ddbba2c2937d04fc1b79d40
Author: Morten N.O. Nørgaard Henriksen <[email protected]>
Date: Wed Aug 4 19:24:41 2021 +0200
Webpack 5 (#11201)
reference:
https://stackoverflow.com/questions/12591247/how-to-find-commit-when-line-was-deleted-removed