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

  • SEARCH
  • Home
  • 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 8587667
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T22:37:25+00:00 2026-06-11T22:37:25+00:00

I have a deleted line in a file in my Git repository. I knew

  • 0

I have a deleted line in a file in my Git repository. I knew some of the missing text, and the file that it was in, so I used git log -S'missingtext' /path/to/file.

However, the only thing that came back was the commit in which I added the line containing the missing text. The text wasn’t present in HEAD, and the commit that added it was present in my branch, so I knew that one of the commits in my branch’s history must have removed it, but it wasn’t showing up.

After some manual searching, it turned out that the line was removed accidentally while resolving a conflict for a merge. So I’m wondering:

  1. Is this the reason why pickaxe couldn’t find the commit that deleted the line?
  2. How could I have found where "missingtext" was deleted without digging through the history manually?

Any insight on #1 would be great (I assumed that git log -S would give me my answer), but my real question is #2 since I’d like to be able to avoid this in the future.

  • 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-11T22:37:27+00:00Added an answer on June 11, 2026 at 10:37 pm

    git log -c -S'missingtext' /path/to/file

    git log doesn’t show a diff for merge commits by default. Try the -c or --cc flags.

    More discussion/explanation:
    https://git-scm.com/docs/git-log
    nabble.com

    From the git-log docs:

    -c With this option, diff output for a merge commit shows the differences from each of the parents to the merge result
    simultaneously instead of showing pairwise diff between a parent and
    the result one at a time. Furthermore, it lists only files which were
    modified from all parents.

    –cc This flag implies the -c option and further compresses the patch output by omitting uninteresting hunks whose contents in the
    parents have only two variants and the merge result picks one of them
    without modification.

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

Sidebar

Related Questions

I have a git repository on an OS X server that used to work
I have noticed that deleted branches in svn is not preserved in git. I
I have a live database that had some data deleted from it and I
I have some problem with sequence generator. I have a file where each line
I have a git repository with some commits in it. I want to reproduce
I have a grideview that displays rows that will be deleted across servers by
I have a SQL Server 2005 database that has been deleted, and I need
If I have a development area that I deleted files from a certain folder/directory,
I use git for my source management, I have a local repository on my
Every day we get a flat text file. Some days there are lines in

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.