Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8930893
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T08:59:39+00:00 2026-06-15T08:59:39+00:00

Is it possible somehow for GIT to find which commit introduced a specific line

  • 0

Is it possible somehow for GIT to find which commit introduced a specific line of code in a specific file? This is assuming that there have been many commits since that line was added. Or is this something that must be done in a script while looking at the git blame of all the commits for the file in which the line is present?

To clarify

Original file->Line Added to file and committed -> Many other commits adding other lines and changing the code

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T08:59:40+00:00Added an answer on June 15, 2026 at 8:59 am

    You can use git blame -l filename to get the SHA1 hash from when the line was changed.

    You also can use –reverse:

    –reverse

    Walk history forward instead of backward. Instead of showing the revision in which a line appeared, this shows the last revision in which a line has existed. This requires a range of revision like START..END where the path to blame exists in START.

    See: http://www.kernel.org/pub/software/scm/git/docs/git-blame.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is this possible somehow to generate a GUID in C#, that mostly corresponds to
Is it somehow possible to identify unused variables in a PHP file in Emacs?
Is it somehow possible, via CSS, to select labels which contains *: at the
I'm using git bisect to find a failure inducing commit. However, a lot of
Is it somehow possible to ignore certain files during git diff? I'm specifically interested
Is it possible somehow to define a constant that says what datatype to use
Is this possible somehow? @Name(geolocationService) public interface GeolocationService { @Query(SELECT g FROM Geolocation geolocation
I'm wondering if it's possible somehow to play a video that has sound (in
I need to recover two Git branches that I somehow deleted during a push.
Is it possible somehow to color specified code in specified color in any version

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.