Skip to content

Instantly share code, notes, and snippets.

@JaosnHsieh
Created February 9, 2022 09:49
Show Gist options
  • Save JaosnHsieh/0d35944cf11355602d5f6611b24264ef to your computer and use it in GitHub Desktop.
Save JaosnHsieh/0d35944cf11355602d5f6611b24264ef to your computer and use it in GitHub Desktop.
How to find commit when line was deleted/removed?

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment