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 9166649
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T15:11:59+00:00 2026-06-17T15:11:59+00:00

10 something commits back, I made a change to .gitignore file. Today when I

  • 0

10 something commits back, I made a change to .gitignore file. Today when I pulled the latest code, my change was not there. So I ran this command:

git log -p .gitignore

And it showed me that the last change to the file was mine. Then I pulled all the commits between now and my commit, and pinpointed the commit that removed my change. Then I took the diff of That commit, and the one before that, and in the diff I could see the change to the file.

But why can’t I see the change through above command? And I don’t even see this change when I use

gitk .gitignore

Also I am wondering, might this happen when I try to see the history of some other file as well?

  • 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-17T15:12:00+00:00Added an answer on June 17, 2026 at 3:12 pm

    Maybe change you’re talking about was introduced by merge with another branch? There are different merge strategies, and despite your commit might be chronologically last one, the merge procedure might prefer older commit which complies with the strategy rules.

    By default git uses recursive strategy which will arrange commits in the order they was created. But maybe in your case merge was done using ours and heirs strategy preferring commits from one branch over commits from another. That’s why you might not see what you actually expect.

    Please visit this Q&A to get more information on strategies.

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

Sidebar

Related Questions

So basically after you commit something on github and change a particular file, and
I commited something wrong twice. How to revert two commits back and commit only
I made something very stupid. I made a commit using git commit (file edits
This is not a major problem, just something I want to know whether or
I don't know if this is something common for people to do or not,
I made some source changes to lint my code. I did not run unit
When I commit something in Mercurial like this: hg commit -m username question I
something I've struggled with in the past and am struggling with today is preventing
Let's say I made a commit today, and tomorrow another Developer made a commit,
There may be more than one way to ask this question, so here's a

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.